perm filename PROVEA.PRO[BMP,SYS] blob sn#759199 filedate 1984-06-09 generic text, type T, neo UTF8
June 9, 1984  12:22:3


(NOTE-LIB BOOT-STRAP.LIB BOOT-STRAP.LISP)

[ 3.24700013 0.0 ]

#FILE-IN-|DSK:BOOT-S.LIB[BMP,SYS]|-71776 


(PROVE-LEMMA PLUS-RIGHT-ID2
	     (REWRITE)
	     (IMPLIES (NOT (NUMBERP Y))
		      (EQUAL (PLUS X Y) (FIX X))))
This formula simplifies, unfolding FIX, to the following two new
conjectures:

Case 2. (IMPLIES (AND (NOT (NUMBERP Y))
		      (NOT (NUMBERP X)))
		 (EQUAL (PLUS X Y) 0)),

  which again simplifies, unfolding the functions PLUS and EQUAL, to:

        T.

Case 1. (IMPLIES (AND (NOT (NUMBERP Y)) (NUMBERP X))
		 (EQUAL (PLUS X Y) X)),

  which we will name *1.


     Let us appeal to the induction principle.  There is only one
suggested induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (ZEROP X) (P X Y))
	   (IMPLIES (AND (NOT (ZEROP X)) (P (SUB1 X) Y))
		    (P X Y))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the
definition of ZEROP can be used to show that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each
induction step of the scheme.  The above induction scheme produces
two new conjectures:

Case 2. (IMPLIES (AND (ZEROP X)
		      (NOT (NUMBERP Y))
		      (NUMBERP X))
		 (EQUAL (PLUS X Y) X)),

  which we simplify, unfolding ZEROP, NUMBERP, EQUAL, and PLUS, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP X))
		      (EQUAL (PLUS (SUB1 X) Y) (SUB1 X))
		      (NOT (NUMBERP Y))
		      (NUMBERP X))
		 (EQUAL (PLUS X Y) X)),

  which simplifies, using linear arithmetic, to:

        (IMPLIES (AND (EQUAL X 0)
		      (NOT (ZEROP X))
		      (EQUAL (PLUS (SUB1 X) Y) (SUB1 X))
		      (NOT (NUMBERP Y))
		      (NUMBERP X))
		 (EQUAL (PLUS X Y) X)).

  But this again simplifies, unfolding the definition of ZEROP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.92900035 0.225 ]

PLUS-RIGHT-ID2 


(PROVE-LEMMA PLUS-ADD1
	     (REWRITE)
	     (EQUAL (PLUS X (ADD1 Y))
		    (IF (NUMBERP Y)
			(ADD1 (PLUS X Y))
			(ADD1 X))))
This conjecture simplifies, obviously, to the following two new goals:

Case 2. (IMPLIES (NOT (NUMBERP Y))
		 (EQUAL (PLUS X (ADD1 Y)) (ADD1 X))),

  which again simplifies, rewriting with SUB1-TYPE-RESTRICTION, to:

        (IMPLIES (NOT (NUMBERP Y))
		 (EQUAL (PLUS X 1) (ADD1 X))).

  This simplifies again, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (NUMBERP Y)
		 (EQUAL (PLUS X (ADD1 Y))
			(ADD1 (PLUS X Y)))),

  which we again simplify, using linear arithmetic, to:

        T.

Q.E.D.


[ 0.330999248 0.076000468 ]

PLUS-ADD1 


(PROVE-LEMMA COMMUTATIVITY2-OF-PLUS
	     (REWRITE)
	     (EQUAL (PLUS X (PLUS Y Z))
		    (PLUS Y (PLUS X Z))))
This formula simplifies, using linear arithmetic, to:

      T.

Q.E.D.


[ 0.055000305 0.0149998983 ]

COMMUTATIVITY2-OF-PLUS 


(PROVE-LEMMA COMMUTATIVITY-OF-PLUS
	     (REWRITE)
	     (EQUAL (PLUS X Y) (PLUS Y X)))
This conjecture simplifies, using linear arithmetic, to:

      T.

Q.E.D.


[ 0.0399993896 0.0170003255 ]

COMMUTATIVITY-OF-PLUS 


(PROVE-LEMMA ASSOCIATIVITY-OF-PLUS
	     (REWRITE)
	     (EQUAL (PLUS (PLUS X Y) Z)
		    (PLUS X (PLUS Y Z))))
This formula simplifies, using linear arithmetic, to:

      T.

Q.E.D.


[ 0.0529993693 0.0150004069 ]

ASSOCIATIVITY-OF-PLUS 


(PROVE-LEMMA PLUS-EQUAL-0
	     (REWRITE)
	     (EQUAL (EQUAL (PLUS A B) 0.)
		    (AND (ZEROP A) (ZEROP B))))
This simplifies, unfolding the functions ZEROP and AND, to six new
conjectures:

Case 6. (IMPLIES (AND (NOT (EQUAL (PLUS A B) 0))
		      (NOT (NUMBERP A)))
		 (NOT (EQUAL B 0))).

  However this again simplifies, applying the lemmas PLUS-RIGHT-ID2
  and COMMUTATIVITY-OF-PLUS, and unfolding NUMBERP and EQUAL, to:

        T.

Case 5. (IMPLIES (AND (NOT (EQUAL (PLUS A B) 0))
		      (NOT (NUMBERP A)))
		 (NUMBERP B)),

  which again simplifies, applying PLUS-RIGHT-ID2, and expanding the
  definition of EQUAL, to:

        T.

Case 4. (IMPLIES (AND (NOT (EQUAL (PLUS A B) 0))
		      (EQUAL A 0))
		 (NOT (EQUAL B 0))),

  which again simplifies, using linear arithmetic, to:

        T.

Case 3. (IMPLIES (AND (NOT (EQUAL (PLUS A B) 0))
		      (EQUAL A 0))
		 (NUMBERP B)),

  which we again simplify, rewriting with PLUS-RIGHT-ID2, and
  unfolding the functions NUMBERP and EQUAL, to:

        T.

Case 2. (IMPLIES (AND (EQUAL (PLUS A B) 0)
		      (NOT (EQUAL A 0)))
		 (NOT (NUMBERP A))).

  But this simplifies again, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (AND (EQUAL (PLUS A B) 0)
		      (NOT (EQUAL B 0)))
		 (NOT (NUMBERP B))).

  However this simplifies again, using linear arithmetic, to:

        T.

Q.E.D.


[ 0.35199992 0.172000121 ]

PLUS-EQUAL-0 


(PROVE-LEMMA DIFFERENCE-X-X
	     (REWRITE)
	     (EQUAL (DIFFERENCE X X) 0.))
This simplifies, using linear arithmetic, to the new conjecture:

      (IMPLIES (LESSP X X)
	       (EQUAL (DIFFERENCE X X) 0)).

However this again simplifies, using linear arithmetic, to:

      T.

Q.E.D.


[ 0.295999654 0.0340001425 ]

DIFFERENCE-X-X 


(PROVE-LEMMA DIFFERENCE-PLUS
	     (REWRITE)
	     (AND (EQUAL (DIFFERENCE (PLUS X Y) X)
			 (FIX Y))
		  (EQUAL (DIFFERENCE (PLUS Y X) X)
			 (FIX Y))))
This conjecture can be simplified, using the abbreviation AND, to the
following two new formulas:

Case 2. (EQUAL (DIFFERENCE (PLUS X Y) X)
	       (FIX Y)).

  This simplifies, expanding the definition of FIX, to the following
  two new formulas:

  Case 2.2.
          (IMPLIES (NOT (NUMBERP Y))
		   (EQUAL (DIFFERENCE (PLUS X Y) X) 0)).

    But this simplifies again, rewriting with PLUS-RIGHT-ID2, to the
    following two new conjectures:

    Case 2.2.2.
            (IMPLIES (AND (NOT (NUMBERP Y))
			  (NOT (NUMBERP X)))
		     (EQUAL (DIFFERENCE 0 X) 0)).

      This simplifies again, expanding the functions EQUAL and
      DIFFERENCE, to:

            T.

    Case 2.2.1.
            (IMPLIES (AND (NOT (NUMBERP Y)) (NUMBERP X))
		     (EQUAL (DIFFERENCE X X) 0)).

      However this simplifies again, using linear arithmetic, to:

            (IMPLIES (AND (LESSP X X)
			  (NOT (NUMBERP Y))
			  (NUMBERP X))
		     (EQUAL (DIFFERENCE X X) 0)),

      which again simplifies, using linear arithmetic, to:

            T.

  Case 2.1.
          (IMPLIES (NUMBERP Y)
		   (EQUAL (DIFFERENCE (PLUS X Y) X) Y)).

    But this simplifies again, using linear arithmetic, to:

          (IMPLIES (AND (LESSP (PLUS X Y) X) (NUMBERP Y))
		   (EQUAL (DIFFERENCE (PLUS X Y) X) Y)),

    which we again simplify, using linear arithmetic, to:

          T.

Case 1. (EQUAL (DIFFERENCE (PLUS Y X) X)
	       (FIX Y)),

  which we simplify, rewriting with COMMUTATIVITY-OF-PLUS, and
  expanding the definition of FIX, to two new conjectures:

  Case 1.2.
          (IMPLIES (NOT (NUMBERP Y))
		   (EQUAL (DIFFERENCE (PLUS X Y) X) 0)),

    which we again simplify, rewriting with PLUS-RIGHT-ID2, to the
    following two new conjectures:

    Case 1.2.2.
            (IMPLIES (AND (NOT (NUMBERP Y))
			  (NOT (NUMBERP X)))
		     (EQUAL (DIFFERENCE 0 X) 0)).

      However this simplifies again, expanding the functions EQUAL
      and DIFFERENCE, to:

            T.

    Case 1.2.1.
            (IMPLIES (AND (NOT (NUMBERP Y)) (NUMBERP X))
		     (EQUAL (DIFFERENCE X X) 0)),

      which again simplifies, using linear arithmetic, to the new
      formula:

            (IMPLIES (AND (LESSP X X)
			  (NOT (NUMBERP Y))
			  (NUMBERP X))
		     (EQUAL (DIFFERENCE X X) 0)),

      which we again simplify, using linear arithmetic, to:

            T.

  Case 1.1.
          (IMPLIES (NUMBERP Y)
		   (EQUAL (DIFFERENCE (PLUS X Y) X) Y)).

    However this simplifies again, using linear arithmetic, to the
    conjecture:

          (IMPLIES (AND (LESSP (PLUS X Y) X) (NUMBERP Y))
		   (EQUAL (DIFFERENCE (PLUS X Y) X) Y)),

    which again simplifies, using linear arithmetic, to:

          T.

Q.E.D.


[ 0.459999595 0.33700002 ]

DIFFERENCE-PLUS 


(PROVE-LEMMA PLUS-CANCELLATION
	     (REWRITE)
	     (EQUAL (EQUAL (PLUS A B) (PLUS A C))
		    (EQUAL (FIX B) (FIX C))))
This conjecture simplifies, expanding the definition of FIX, to seven
new goals:

Case 7. (IMPLIES (AND (NUMBERP C)
		      (NUMBERP B)
		      (NOT (EQUAL B C)))
		 (NOT (EQUAL (PLUS A B) (PLUS A C)))),

  which we again simplify, using linear arithmetic, to:

        T.

Case 6. (IMPLIES (AND (NUMBERP C)
		      (NOT (NUMBERP B))
		      (NOT (EQUAL 0 C)))
		 (NOT (EQUAL (PLUS A B) (PLUS A C)))).

  However this simplifies again, applying the lemma PLUS-RIGHT-ID2,
  to two new conjectures:

  Case 6.2.
          (IMPLIES (AND (NUMBERP C)
			(NOT (NUMBERP B))
			(NOT (EQUAL 0 C))
			(NOT (NUMBERP A)))
		   (NOT (EQUAL 0 (PLUS A C)))),

    which again simplifies, using linear arithmetic, to:

          T.

  Case 6.1.
          (IMPLIES (AND (NUMBERP C)
			(NOT (NUMBERP B))
			(NOT (EQUAL 0 C))
			(NUMBERP A))
		   (NOT (EQUAL A (PLUS A C)))),

    which we again simplify, using linear arithmetic, to:

          T.

Case 5. (IMPLIES (AND (NOT (NUMBERP C))
		      (NUMBERP B)
		      (NOT (EQUAL B 0)))
		 (NOT (EQUAL (PLUS A B) (PLUS A C)))).

  However this again simplifies, appealing to the lemma
  PLUS-RIGHT-ID2, to two new conjectures:

  Case 5.2.
          (IMPLIES (AND (NOT (NUMBERP C))
			(NUMBERP B)
			(NOT (EQUAL B 0))
			(NOT (NUMBERP A)))
		   (NOT (EQUAL (PLUS A B) 0))),

    which we again simplify, using linear arithmetic, to:

          T.

  Case 5.1.
          (IMPLIES (AND (NOT (NUMBERP C))
			(NUMBERP B)
			(NOT (EQUAL B 0))
			(NUMBERP A))
		   (NOT (EQUAL (PLUS A B) A))),

    which we again simplify, using linear arithmetic, to:

          T.

Case 4. (IMPLIES (AND (NOT (NUMBERP C))
		      (NOT (NUMBERP B)))
		 (EQUAL (EQUAL (PLUS A B) (PLUS A C))
			T)),

  which we again simplify, applying PLUS-RIGHT-ID2, and expanding the
  definition of EQUAL, to:

        T.

Case 3. (IMPLIES (AND (NOT (NUMBERP C)) (EQUAL B 0))
		 (EQUAL (EQUAL (PLUS A B) (PLUS A C))
			T)),

  which we again simplify, rewriting with COMMUTATIVITY-OF-PLUS and
  PLUS-RIGHT-ID2, and unfolding the definitions of EQUAL and PLUS, to:

        T.

Case 2. (IMPLIES (AND (NOT (NUMBERP B)) (EQUAL 0 C))
		 (EQUAL (EQUAL (PLUS A B) (PLUS A C))
			T)).

  However this simplifies again, applying PLUS-RIGHT-ID2 and
  COMMUTATIVITY-OF-PLUS, and opening up EQUAL and PLUS, to:

        T.

Case 1. (IMPLIES (AND (NUMBERP C)
		      (NUMBERP B)
		      (EQUAL B C))
		 (EQUAL (EQUAL (PLUS A B) (PLUS A C))
			T)).

  But this simplifies again, unfolding the definition of EQUAL, to:

        T.

Q.E.D.


[ 0.42699941 0.316000365 ]

PLUS-CANCELLATION 


(PROVE-LEMMA DIFFERENCE-0
	     (REWRITE)
	     (IMPLIES ( LEQ X Y)
		      (EQUAL (DIFFERENCE X Y) 0.)))

     Name the conjecture *1.


     Perhaps we can prove it by induction.  The recursive terms in
the conjecture suggest four inductions.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (OR (EQUAL X 0) (NOT (NUMBERP X)))
		    (P X Y))
	   (IMPLIES (AND (NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
			 (OR (EQUAL Y 0) (NOT (NUMBERP Y))))
		    (P X Y))
	   (IMPLIES (AND (NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
			 (NOT (OR (EQUAL Y 0) (NOT (NUMBERP Y))))
			 (P (SUB1 X) (SUB1 Y)))
		    (P X Y))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the
definitions of OR and NOT can be used to prove that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  Note, however, the inductive
instance chosen for X.  The above induction scheme generates four new
conjectures:

Case 4. (IMPLIES (AND (OR (EQUAL X 0) (NOT (NUMBERP X)))
		      ( LEQ X Y))
		 (EQUAL (DIFFERENCE X Y) 0)),

  which simplifies, opening up the definitions of NOT, OR, EQUAL,
  LESSP, and DIFFERENCE, to:

        T.

Case 3. (IMPLIES (AND (NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
		      (OR (EQUAL Y 0) (NOT (NUMBERP Y)))
		      ( LEQ X Y))
		 (EQUAL (DIFFERENCE X Y) 0)).

  This simplifies, expanding the functions NOT, OR, EQUAL, and LESSP,
  to:

        T.

Case 2. (IMPLIES (AND (NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
		      (NOT (OR (EQUAL Y 0) (NOT (NUMBERP Y))))
		      (LESSP (SUB1 Y) (SUB1 X))
		      ( LEQ X Y))
		 (EQUAL (DIFFERENCE X Y) 0)),

  which we simplify, using linear arithmetic, to:

        (IMPLIES (AND (LESSP X 1)
		      (NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
		      (NOT (OR (EQUAL Y 0) (NOT (NUMBERP Y))))
		      (LESSP (SUB1 Y) (SUB1 X))
		      ( LEQ X Y))
		 (EQUAL (DIFFERENCE X Y) 0)),

  which again simplifies, unfolding the functions SUB1, NUMBERP,
  EQUAL, LESSP, NOT, and OR, to:

        T.

Case 1. (IMPLIES (AND (NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
		      (NOT (OR (EQUAL Y 0) (NOT (NUMBERP Y))))
		      (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
			     0)
		      ( LEQ X Y))
		 (EQUAL (DIFFERENCE X Y) 0)).

  This simplifies, using linear arithmetic, to the following three
  new goals:

  Case 1.3.
          (IMPLIES (AND (LESSP X Y)
			(NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
			(NOT (OR (EQUAL Y 0) (NOT (NUMBERP Y))))
			(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
			       0)
			( LEQ X Y))
		   (EQUAL (DIFFERENCE X Y) 0)).

    However this again simplifies, using linear arithmetic, to two
    new conjectures:

    Case 1.3.2.
            (IMPLIES (AND (LESSP (SUB1 X) (SUB1 Y))
			  (LESSP X Y)
			  (NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
			  (NOT (OR (EQUAL Y 0) (NOT (NUMBERP Y))))
			  (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
				 0)
			  ( LEQ X Y))
		     (EQUAL (DIFFERENCE X Y) 0)),

      which we again simplify, unfolding the definitions of LESSP,
      NOT, OR, DIFFERENCE, and EQUAL, to:

            T.

    Case 1.3.1.
            (IMPLIES (AND (LESSP X 1)
			  (LESSP X Y)
			  (NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
			  (NOT (OR (EQUAL Y 0) (NOT (NUMBERP Y))))
			  (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
				 0)
			  ( LEQ X Y))
		     (EQUAL (DIFFERENCE X Y) 0)).

      This simplifies again, opening up SUB1, NUMBERP, EQUAL, LESSP,
      NOT, and OR, to:

            T.

  Case 1.2.
          (IMPLIES (AND (LESSP (SUB1 X) (SUB1 Y))
			(NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
			(NOT (OR (EQUAL Y 0) (NOT (NUMBERP Y))))
			(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
			       0)
			( LEQ X Y))
		   (EQUAL (DIFFERENCE X Y) 0)),

    which again simplifies, expanding the definitions of NOT, OR,
    LESSP, DIFFERENCE, and EQUAL, to:

          T.

  Case 1.1.
          (IMPLIES (AND (LESSP X 1)
			(NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
			(NOT (OR (EQUAL Y 0) (NOT (NUMBERP Y))))
			(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
			       0)
			( LEQ X Y))
		   (EQUAL (DIFFERENCE X Y) 0)),

    which we again simplify, expanding the functions SUB1, NUMBERP,
    EQUAL, LESSP, NOT, and OR, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 1.7450002 0.520999655 ]

DIFFERENCE-0 


(PROVE-LEMMA EQUAL-DIFFERENCE-0
	     (REWRITE)
	     (EQUAL (EQUAL 0. (DIFFERENCE X Y))
		    ( LEQ X Y)))
This conjecture simplifies, opening up NOT, to the following two new
goals:

Case 2. (IMPLIES (NOT (EQUAL 0 (DIFFERENCE X Y)))
		 (LESSP Y X)),

  which we again simplify, applying DIFFERENCE-0, and unfolding the
  function EQUAL, to:

        T.

Case 1. (IMPLIES (EQUAL 0 (DIFFERENCE X Y))
		 ( LEQ X Y)),

  which we again simplify, using linear arithmetic, to:

        T.

Q.E.D.


[ 0.166000875 0.0579991657 ]

EQUAL-DIFFERENCE-0 


(PROVE-LEMMA DIFFERENCE-CANCELLATION-0
	     (REWRITE)
	     (EQUAL (EQUAL X (DIFFERENCE X Y))
		    (AND (NUMBERP X)
			 (OR (EQUAL X 0.) (ZEROP Y)))))
This simplifies, opening up the functions ZEROP, OR, and AND, to the
following five new goals:

Case 5. (IMPLIES (EQUAL X (DIFFERENCE X Y))
		 (NUMBERP X)),

  which again simplifies, trivially, to:

        T.

Case 4. (IMPLIES (AND (EQUAL X (DIFFERENCE X Y))
		      (NOT (EQUAL X 0))
		      (NOT (EQUAL Y 0)))
		 (NOT (NUMBERP Y))),

  which we again simplify, using linear arithmetic, to:

        (IMPLIES (AND (LESSP X Y)
		      (EQUAL X (DIFFERENCE X Y))
		      (NOT (EQUAL X 0))
		      (NOT (EQUAL Y 0)))
		 (NOT (NUMBERP Y))),

  which again simplifies, using linear arithmetic and applying the
  lemma DIFFERENCE-0, to:

        T.

Case 3. (IMPLIES (AND (NOT (EQUAL X (DIFFERENCE X Y)))
		      (NUMBERP X))
		 (NUMBERP Y)).

  However this simplifies again, opening up the definition of
  DIFFERENCE, to:

        T.

Case 2. (IMPLIES (AND (NOT (EQUAL X (DIFFERENCE X Y)))
		      (NUMBERP X))
		 (NOT (EQUAL Y 0))),

  which we again simplify, using linear arithmetic, to the formula:

        (IMPLIES (AND (LESSP X 0)
		      (NOT (EQUAL X (DIFFERENCE X 0))))
		 (NOT (NUMBERP X))),

  which again simplifies, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (AND (NOT (EQUAL X (DIFFERENCE X Y)))
		      (NUMBERP X))
		 (NOT (EQUAL X 0))),

  which again simplifies, using linear arithmetic, appealing to the
  lemma DIFFERENCE-0, and unfolding the definition of EQUAL, to:

        T.

Q.E.D.


[ 0.340999857 0.185000101 ]

DIFFERENCE-CANCELLATION-0 


(PROVE-LEMMA DIFFERENCE-CANCELLATION-1
	     (REWRITE)
	     (EQUAL (EQUAL (DIFFERENCE X Y)
			   (DIFFERENCE Z Y))
		    (IF (LESSP X Y)
			( LEQ Z Y)
			(IF (LESSP Z Y)
			    ( LEQ X Y)
			    (EQUAL (FIX X) (FIX Z))))))
This conjecture simplifies, unfolding the functions NOT and FIX, to
11 new conjectures:

Case 11.(IMPLIES (AND (EQUAL (DIFFERENCE X Y)
			     (DIFFERENCE Z Y))
		      ( LEQ Y X)
		      ( LEQ Y Z)
		      (NOT (NUMBERP Z))
		      (NUMBERP X))
		 (EQUAL (EQUAL X 0) T)).

  However this simplifies again, using linear arithmetic, applying
  the lemmas DIFFERENCE-0 and EQUAL-DIFFERENCE-0, and expanding the
  definition of LESSP, to two new formulas:

  Case 11.2.
          (IMPLIES (AND ( LEQ X Y)
			( LEQ Y X)
			(EQUAL Y 0)
			(NOT (NUMBERP Z))
			(NUMBERP X))
		   (EQUAL X 0)),

    which we again simplify, using linear arithmetic, to:

          T.

  Case 11.1.
          (IMPLIES (AND ( LEQ X Y)
			( LEQ Y X)
			(NOT (NUMBERP Y))
			(NOT (NUMBERP Z))
			(NUMBERP X))
		   (EQUAL X 0)).

    However this again simplifies, opening up the function LESSP, to:

          T.

Case 10.(IMPLIES (AND (EQUAL (DIFFERENCE X Y)
			     (DIFFERENCE Z Y))
		      ( LEQ Y X)
		      ( LEQ Y Z)
		      (NUMBERP Z)
		      (NOT (NUMBERP X)))
		 (EQUAL (EQUAL 0 Z) T)),

  which again simplifies, using linear arithmetic, rewriting with
  DIFFERENCE-0 and EQUAL-DIFFERENCE-0, and expanding LESSP and EQUAL,
  to two new formulas:

  Case 10.2.
          (IMPLIES (AND ( LEQ Z Y)
			(EQUAL Y 0)
			(NUMBERP Z)
			(NOT (NUMBERP X)))
		   (EQUAL 0 Z)),

    which again simplifies, using linear arithmetic, to:

          T.

  Case 10.1.
          (IMPLIES (AND ( LEQ Z Y)
			(NOT (NUMBERP Y))
			(NUMBERP Z)
			(NOT (NUMBERP X)))
		   (EQUAL 0 Z)),

    which we again simplify, opening up LESSP, to:

          T.

Case 9. (IMPLIES (AND (EQUAL (DIFFERENCE X Y)
			     (DIFFERENCE Z Y))
		      ( LEQ Y X)
		      ( LEQ Y Z)
		      (NUMBERP Z)
		      (NUMBERP X))
		 (EQUAL (EQUAL X Z) T)),

  which again simplifies, clearly, to:

        (IMPLIES (AND (EQUAL (DIFFERENCE X Y)
			     (DIFFERENCE Z Y))
		      ( LEQ Y X)
		      ( LEQ Y Z)
		      (NUMBERP Z)
		      (NUMBERP X))
		 (EQUAL X Z)),

  which we again simplify, using linear arithmetic, to:

        T.

Case 8. (IMPLIES (AND (NOT (EQUAL (DIFFERENCE X Y)
				  (DIFFERENCE Z Y)))
		      ( LEQ Y X)
		      ( LEQ Y Z)
		      (NOT (NUMBERP Z)))
		 (NOT (EQUAL X 0))).

  But this simplifies again, using linear arithmetic, applying
  DIFFERENCE-0, and opening up EQUAL, to:

        T.

Case 7. (IMPLIES (AND (NOT (EQUAL (DIFFERENCE X Y)
				  (DIFFERENCE Z Y)))
		      ( LEQ Y X)
		      ( LEQ Y Z)
		      (NOT (NUMBERP X)))
		 (NOT (EQUAL 0 Z))).

  This simplifies again, using linear arithmetic, applying
  DIFFERENCE-0, and unfolding EQUAL, to:

        T.

Case 6. (IMPLIES (AND (NOT (EQUAL (DIFFERENCE X Y)
				  (DIFFERENCE Z Y)))
		      ( LEQ Y X)
		      ( LEQ Y Z)
		      (NUMBERP Z)
		      (NUMBERP X))
		 (NOT (EQUAL X Z))),

  which again simplifies, clearly, to:

        T.

Case 5. (IMPLIES (AND (NOT (EQUAL (DIFFERENCE X Y)
				  (DIFFERENCE Z Y)))
		      (LESSP X Y))
		 (LESSP Y Z)),

  which again simplifies, using linear arithmetic, rewriting with
  DIFFERENCE-0, and expanding the definition of EQUAL, to:

        T.

Case 4. (IMPLIES (AND (NOT (EQUAL (DIFFERENCE X Y)
				  (DIFFERENCE Z Y)))
		      ( LEQ Y X)
		      ( LEQ Y Z)
		      (NOT (NUMBERP Z)))
		 (NUMBERP X)).

  This again simplifies, using linear arithmetic, rewriting with the
  lemma DIFFERENCE-0, and expanding the function EQUAL, to:

        T.

Case 3. (IMPLIES (AND (NOT (EQUAL (DIFFERENCE X Y)
				  (DIFFERENCE Z Y)))
		      ( LEQ Y X)
		      (LESSP Z Y))
		 (LESSP Y X)).

  This simplifies again, using linear arithmetic, to three new
  conjectures:

  Case 3.3.
          (IMPLIES (AND (NOT (NUMBERP Y))
			(NOT (EQUAL (DIFFERENCE X Y)
				    (DIFFERENCE Z Y)))
			( LEQ Y X)
			(LESSP Z Y))
		   (LESSP Y X)),

    which we again simplify, appealing to the lemma DIFFERENCE-0, and
    expanding the functions DIFFERENCE and LESSP, to:

          T.

  Case 3.2.
          (IMPLIES (AND (NOT (NUMBERP X))
			(NOT (EQUAL (DIFFERENCE X Y)
				    (DIFFERENCE Z Y)))
			( LEQ Y X)
			(LESSP Z Y))
		   (LESSP Y X)),

    which we again simplify, using linear arithmetic, rewriting with
    DIFFERENCE-0, and opening up the function EQUAL, to:

          T.

  Case 3.1.
          (IMPLIES (AND (NUMBERP X)
			(NUMBERP Y)
			(NOT (EQUAL (DIFFERENCE X X)
				    (DIFFERENCE Z X)))
			( LEQ X X)
			(LESSP Z X))
		   (LESSP X X)),

    which again simplifies, using linear arithmetic, applying
    DIFFERENCE-0, and opening up the definition of EQUAL, to:

          T.

Case 2. (IMPLIES (AND (EQUAL (DIFFERENCE X Y)
			     (DIFFERENCE Z Y))
		      (LESSP X Y))
		 ( LEQ Z Y)),

  which we again simplify, using linear arithmetic and applying
  DIFFERENCE-0 and EQUAL-DIFFERENCE-0, to:

        T.

Case 1. (IMPLIES (AND (EQUAL (DIFFERENCE X Y)
			     (DIFFERENCE Z Y))
		      ( LEQ Y X)
		      (LESSP Z Y))
		 ( LEQ X Y)).

  However this again simplifies, using linear arithmetic and applying
  DIFFERENCE-0 and EQUAL-DIFFERENCE-0, to:

        T.

Q.E.D.


[ 1.70799917 1.24400075 ]

DIFFERENCE-CANCELLATION-1 


(DEFN APPEND
      (X Y)
      (IF (LISTP X)
	  (CONS (CAR X) (APPEND (CDR X) Y))
	  Y))
     Linear arithmetic and the lemma CDR-LESSP inform us that the
measure (COUNT X) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, APPEND is accepted under the
principle of definition.  Observe that:
      (OR (LISTP (APPEND X Y))
	  (EQUAL (APPEND X Y) Y))
is a theorem.




[ 1.1449997 0.0490000406 ]

APPEND 


(DEFN DELETE
      (X Y)
      (IF (LISTP Y)
	  (IF (EQUAL X (CAR Y))
	      (CDR Y)
	      (CONS (CAR Y) (DELETE X (CDR Y))))
	  Y))
     Linear arithmetic and the lemma CDR-LESSP inform us that the
measure (COUNT Y) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, DELETE is accepted under the
principle of definition.




[ 0.119999695 0.0310002645 ]

DELETE 


(DEFN SUBBAGP
      (X Y)
      (IF (LISTP X)
	  (IF (MEMBER (CAR X) Y)
	      (SUBBAGP (CDR X) (DELETE (CAR X) Y))
	      F)
	  T))
     Linear arithmetic and the lemma CDR-LESSP establish that the
measure (COUNT X) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, SUBBAGP is accepted under the
principle of definition.  Note that:
      (OR (FALSEP (SUBBAGP X Y))
	  (TRUEP (SUBBAGP X Y)))
is a theorem.




[ 0.667999774 0.0440002442 ]

SUBBAGP 


(DEFN BAGDIFF
      (X Y)
      (IF (LISTP Y)
	  (IF (MEMBER (CAR Y) X)
	      (BAGDIFF (DELETE (CAR Y) X) (CDR Y))
	      (BAGDIFF X (CDR Y)))
	  X))
     Linear arithmetic and the lemma CDR-LESSP inform us that the
measure (COUNT Y) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, BAGDIFF is accepted under the
principle of definition.




[ 0.126999918 0.0320002236 ]

BAGDIFF 


(DEFN BAGINT
      (X Y)
      (IF (LISTP X)
	  (IF (MEMBER (CAR X) Y)
	      (CONS (CAR X)
		    (BAGINT (CDR X) (DELETE (CAR X) Y)))
	      (BAGINT (CDR X) Y))
	  NIL))
     Linear arithmetic and the lemma CDR-LESSP establish that the
measure (COUNT X) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, BAGINT is accepted under the
definitional principle.  From the definition we can conclude that:
      (OR (LITATOM (BAGINT X Y))
	  (LISTP (BAGINT X Y)))
is a theorem.




[ 0.282999676 0.0470001223 ]

BAGINT 


(PROVE-LEMMA DELETE-NON-MEMBER
	     (REWRITE)
	     (IMPLIES (NOT (MEMBER X Y))
		      (EQUAL (DELETE X Y) Y)))

     Name the conjecture *1.


     Perhaps we can prove it by induction.  The recursive terms in
the conjecture suggest two inductions.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (NLISTP Y) (P X Y))
	   (IMPLIES (AND (NOT (NLISTP Y))
			 (EQUAL X (CAR Y)))
		    (P X Y))
	   (IMPLIES (AND (NOT (NLISTP Y))
			 (NOT (EQUAL X (CAR Y)))
			 (P X (CDR Y)))
		    (P X Y))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP can be used to prove that the measure (COUNT Y)
decreases according to the well-founded relation LESSP in each
induction step of the scheme.  The above induction scheme generates
four new conjectures:

Case 4. (IMPLIES (AND (NLISTP Y) (NOT (MEMBER X Y)))
		 (EQUAL (DELETE X Y) Y)),

  which simplifies, opening up the definitions of NLISTP, MEMBER, and
  DELETE, to:

        T.

Case 3. (IMPLIES (AND (NOT (NLISTP Y))
		      (EQUAL X (CAR Y))
		      (NOT (MEMBER X Y)))
		 (EQUAL (DELETE X Y) Y)).

  This simplifies, expanding the functions NLISTP and MEMBER, to:

        T.

Case 2. (IMPLIES (AND (NOT (NLISTP Y))
		      (NOT (EQUAL X (CAR Y)))
		      (MEMBER X (CDR Y))
		      (NOT (MEMBER X Y)))
		 (EQUAL (DELETE X Y) Y)),

  which we simplify, expanding the functions NLISTP and MEMBER, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP Y))
		      (NOT (EQUAL X (CAR Y)))
		      (EQUAL (DELETE X (CDR Y)) (CDR Y))
		      (NOT (MEMBER X Y)))
		 (EQUAL (DELETE X Y) Y)).

  This simplifies, rewriting with the lemma CONS-CAR-CDR, and
  unfolding the functions NLISTP, MEMBER, and DELETE, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.52799988 0.247000631 ]

DELETE-NON-MEMBER 


(PROVE-LEMMA MEMBER-DELETE
	     (REWRITE)
	     (IMPLIES (MEMBER X (DELETE U V))
		      (MEMBER X V)))

WARNING:  Note that MEMBER-DELETE contains the free variable U which
will be chosen by instantiating the hypothesis
(MEMBER X (DELETE U V)).


     Give the conjecture the name *1.


     We will try to prove it by induction.  Two inductions are
suggested by terms in the conjecture.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (LISTP V) (EQUAL U (CAR V)))
		    (P X V U))
	   (IMPLIES (AND (LISTP V)
			 (NOT (EQUAL U (CAR V)))
			 (P X (CDR V) U))
		    (P X V U))
	   (IMPLIES (NOT (LISTP V)) (P X V U))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT V) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme leads
to the following four new goals:

Case 4. (IMPLIES (AND (LISTP V)
		      (EQUAL U (CAR V))
		      (MEMBER X (DELETE U V)))
		 (MEMBER X V)),

  which we simplify, expanding DELETE and MEMBER, to:

        T.

Case 3. (IMPLIES (AND (LISTP V)
		      (NOT (EQUAL U (CAR V)))
		      (NOT (MEMBER X (DELETE U (CDR V))))
		      (MEMBER X (DELETE U V)))
		 (MEMBER X V)).

  This simplifies, applying CDR-CONS and CAR-CONS, and unfolding
  DELETE and MEMBER, to:

        T.

Case 2. (IMPLIES (AND (LISTP V)
		      (NOT (EQUAL U (CAR V)))
		      (MEMBER X (CDR V))
		      (MEMBER X (DELETE U V)))
		 (MEMBER X V)),

  which simplifies, applying CDR-CONS and CAR-CONS, and expanding the
  definitions of DELETE and MEMBER, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP V))
		      (MEMBER X (DELETE U V)))
		 (MEMBER X V)),

  which simplifies, rewriting with DELETE-NON-MEMBER, and opening up
  MEMBER, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.50099996 0.240000406 ]

MEMBER-DELETE 


(PROVE-LEMMA COMMUTATIVITY-OF-DELETE
	     (REWRITE)
	     (EQUAL (DELETE X (DELETE Y Z))
		    (DELETE Y (DELETE X Z))))

     Give the conjecture the name *1.


     Let us appeal to the induction principle.  The recursive terms
in the conjecture suggest two inductions.  However, they merge into
one likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (LISTP Z) (EQUAL Y (CAR Z)))
		    (P X Y Z))
	   (IMPLIES (AND (LISTP Z)
			 (NOT (EQUAL Y (CAR Z)))
			 (P X Y (CDR Z)))
		    (P X Y Z))
	   (IMPLIES (NOT (LISTP Z)) (P X Y Z))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT Z) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
generates three new conjectures:

Case 3. (IMPLIES (AND (LISTP Z) (EQUAL Y (CAR Z)))
		 (EQUAL (DELETE X (DELETE Y Z))
			(DELETE Y (DELETE X Z)))),

  which simplifies, opening up the definition of DELETE, to the
  following two new formulas:

  Case 3.2.
          (IMPLIES
		  (AND (LISTP Z)
		       (NOT (EQUAL X (CAR Z))))
		  (EQUAL (DELETE X (CDR Z))
			 (DELETE (CAR Z)
				 (CONS (CAR Z) (DELETE X (CDR Z)))))),

    which again simplifies, applying CDR-CONS and CAR-CONS, and
    expanding the definition of DELETE, to:

          T.

  Case 3.1.
          (IMPLIES (AND (LISTP Z) (EQUAL X (CAR Z)))
		   (EQUAL (DELETE X (CDR Z))
			  (DELETE (CAR Z) (CDR Z)))),

    which again simplifies, obviously, to:

          T.

Case 2. (IMPLIES (AND (LISTP Z)
		      (NOT (EQUAL Y (CAR Z)))
		      (EQUAL (DELETE X (DELETE Y (CDR Z)))
			     (DELETE Y (DELETE X (CDR Z)))))
		 (EQUAL (DELETE X (DELETE Y Z))
			(DELETE Y (DELETE X Z)))),

  which simplifies, rewriting with CDR-CONS and CAR-CONS, and opening
  up the function DELETE, to the new conjecture:

        (IMPLIES (AND (LISTP Z)
		      (NOT (EQUAL Y (CAR Z)))
		      (EQUAL (DELETE X (DELETE Y (CDR Z)))
			     (DELETE Y (DELETE X (CDR Z))))
		      (NOT (EQUAL X (CAR Z))))
		 (EQUAL (CONS (CAR Z)
			      (DELETE X (DELETE Y (CDR Z))))
			(DELETE Y
				(CONS (CAR Z) (DELETE X (CDR Z)))))),

  which we again simplify, rewriting with CDR-CONS and CAR-CONS, and
  opening up DELETE, to:

        T.

Case 1. (IMPLIES (NOT (LISTP Z))
		 (EQUAL (DELETE X (DELETE Y Z))
			(DELETE Y (DELETE X Z)))),

  which simplifies, applying DELETE-NON-MEMBER, and expanding the
  function MEMBER, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.57400005 0.304999795 ]

COMMUTATIVITY-OF-DELETE 


(PROVE-LEMMA SUBBAGP-DELETE
	     (REWRITE)
	     (IMPLIES (SUBBAGP X (DELETE U Y))
		      (SUBBAGP X Y)))

WARNING:  Note that SUBBAGP-DELETE contains the free variable U which
will be chosen by instantiating the hypothesis
(SUBBAGP X (DELETE U Y)).


     Give the conjecture the name *1.


     We will try to prove it by induction.  Three inductions are
suggested by terms in the conjecture.  They merge into two likely
candidate inductions.  However, only one is unflawed.  We will induct
according to the following scheme:
      (AND (IMPLIES (AND (LISTP X)
			 (MEMBER (CAR X) (DELETE U Y))
			 (P (CDR X) (DELETE (CAR X) Y) U))
		    (P X Y U))
	   (IMPLIES (AND (LISTP X)
			 (NOT (MEMBER (CAR X) (DELETE U Y))))
		    (P X Y U))
	   (IMPLIES (NOT (LISTP X)) (P X Y U))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  Note, however, the inductive
instance chosen for Y.  The above induction scheme leads to the
following four new goals:

Case 4. (IMPLIES (AND (LISTP X)
		      (MEMBER (CAR X) (DELETE U Y))
		      (NOT (SUBBAGP (CDR X)
				    (DELETE U (DELETE (CAR X) Y))))
		      (SUBBAGP X (DELETE U Y)))
		 (SUBBAGP X Y)),

  which we simplify, applying COMMUTATIVITY-OF-DELETE, and unfolding
  the function SUBBAGP, to:

        T.

Case 3. (IMPLIES (AND (LISTP X)
		      (MEMBER (CAR X) (DELETE U Y))
		      (SUBBAGP (CDR X) (DELETE (CAR X) Y))
		      (SUBBAGP X (DELETE U Y)))
		 (SUBBAGP X Y)),

  which we simplify, rewriting with COMMUTATIVITY-OF-DELETE and
  MEMBER-DELETE, and unfolding the definition of SUBBAGP, to:

        T.

Case 2. (IMPLIES (AND (LISTP X)
		      (NOT (MEMBER (CAR X) (DELETE U Y)))
		      (SUBBAGP X (DELETE U Y)))
		 (SUBBAGP X Y)).

  This simplifies, expanding the definition of SUBBAGP, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP X))
		      (SUBBAGP X (DELETE U Y)))
		 (SUBBAGP X Y)),

  which simplifies, unfolding the function SUBBAGP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.70799764 0.251003012 ]

SUBBAGP-DELETE 


(PROVE-LEMMA SUBBAGP-CDR1
	     (REWRITE)
	     (IMPLIES (SUBBAGP X Y)
		      (SUBBAGP (CDR X) Y)))
.

Applying the lemma CAR-CDR-ELIM, replace X by (CONS V Z) to eliminate
(CDR X) and (CAR X).  We thus obtain the following two new goals:

Case 2. (IMPLIES (AND (NOT (LISTP X)) (SUBBAGP X Y))
		 (SUBBAGP (CDR X) Y)),

  which simplifies, applying the lemma CDR-NLISTP, and expanding the
  definitions of SUBBAGP and LISTP, to:

        T.

Case 1. (IMPLIES (SUBBAGP (CONS V Z) Y)
		 (SUBBAGP Z Y)),

  which simplifies, applying the lemmas CDR-CONS, CAR-CONS, and
  SUBBAGP-DELETE, and unfolding SUBBAGP, to:

        T.

Q.E.D.


[ 1.26799724 0.083002727 ]

SUBBAGP-CDR1 


(PROVE-LEMMA SUBBAGP-CDR2
	     (REWRITE)
	     (IMPLIES (SUBBAGP X (CDR Y))
		      (SUBBAGP X Y)))
.

Applying the lemma CAR-CDR-ELIM, replace Y by (CONS V Z) to eliminate
(CDR Y) and (CAR Y).  We thus obtain the following two new goals:

Case 2. (IMPLIES (AND (NOT (LISTP Y))
		      (SUBBAGP X (CDR Y)))
		 (SUBBAGP X Y)),

  which simplifies, applying the lemma CDR-NLISTP, and expanding the
  definitions of MEMBER, LISTP, and SUBBAGP, to:

        T.

Case 1. (IMPLIES (SUBBAGP X Z)
		 (SUBBAGP X (CONS V Z))),

  which we would normally push and work on later by induction.  But
  if we must use induction to prove the input conjecture, we prefer
  to induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us return to:

(IMPLIES (SUBBAGP X (CDR Y))
	 (SUBBAGP X Y)),

named *1 above.  We will appeal to induction.  The recursive terms in
the conjecture suggest two inductions.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (LISTP X)
			 (MEMBER (CAR X) (CDR Y))
			 (P (CDR X) (DELETE (CAR X) Y)))
		    (P X Y))
	   (IMPLIES (AND (LISTP X)
			 (NOT (MEMBER (CAR X) (CDR Y))))
		    (P X Y))
	   (IMPLIES (NOT (LISTP X)) (P X Y))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  Note, however, the inductive
instance chosen for Y.  The above induction scheme produces four new
conjectures:

Case 4. (IMPLIES (AND (LISTP X)
		      (MEMBER (CAR X) (CDR Y))
		      (NOT (SUBBAGP (CDR X)
				    (CDR (DELETE (CAR X) Y))))
		      (SUBBAGP X (CDR Y)))
		 (SUBBAGP X Y)),

  which we simplify, unfolding SUBBAGP and MEMBER, to two new
  formulas:

  Case 4.2.
          (IMPLIES (AND (LISTP X)
			(MEMBER (CAR X) (CDR Y))
			(NOT (SUBBAGP (CDR X)
				      (CDR (DELETE (CAR X) Y))))
			(SUBBAGP (CDR X)
				 (DELETE (CAR X) (CDR Y))))
		   (LISTP Y)),

    which again simplifies, appealing to the lemma CDR-NLISTP, and
    unfolding the definitions of LISTP and MEMBER, to:

          T.

  Case 4.1.
          (IMPLIES (AND (LISTP X)
			(MEMBER (CAR X) (CDR Y))
			(NOT (SUBBAGP (CDR X)
				      (CDR (DELETE (CAR X) Y))))
			(SUBBAGP (CDR X)
				 (DELETE (CAR X) (CDR Y))))
		   (SUBBAGP (CDR X) (DELETE (CAR X) Y))),

    which we further simplify, rewriting with CDR-NLISTP,
    DELETE-NON-MEMBER, and SUBBAGP-CDR1, and opening up DELETE,
    MEMBER, LISTP, and SUBBAGP, to:

          (IMPLIES
	    (AND (LISTP X)
		 (MEMBER (CAR X) (CDR Y))
		 (LISTP Y)
		 (NOT (EQUAL (CAR X) (CAR Y)))
		 (NOT (SUBBAGP (CDR X)
			       (CDR (CONS (CAR Y)
					  (DELETE (CAR X) (CDR Y))))))
		 (SUBBAGP (CDR X)
			  (DELETE (CAR X) (CDR Y))))
	    (SUBBAGP (CDR X)
		     (CONS (CAR Y)
			   (DELETE (CAR X) (CDR Y))))).

    This simplifies again, rewriting with the lemma CDR-CONS, to:

          T.

Case 3. (IMPLIES (AND (LISTP X)
		      (MEMBER (CAR X) (CDR Y))
		      (SUBBAGP (CDR X) (DELETE (CAR X) Y))
		      (SUBBAGP X (CDR Y)))
		 (SUBBAGP X Y)),

  which simplifies, expanding the definitions of SUBBAGP and MEMBER,
  to:

        (IMPLIES (AND (LISTP X)
		      (MEMBER (CAR X) (CDR Y))
		      (SUBBAGP (CDR X) (DELETE (CAR X) Y))
		      (SUBBAGP (CDR X)
			       (DELETE (CAR X) (CDR Y))))
		 (LISTP Y)),

  which again simplifies, rewriting with the lemma CDR-NLISTP, and
  expanding the functions LISTP and MEMBER, to:

        T.

Case 2. (IMPLIES (AND (LISTP X)
		      (NOT (MEMBER (CAR X) (CDR Y)))
		      (SUBBAGP X (CDR Y)))
		 (SUBBAGP X Y)),

  which simplifies, expanding the function SUBBAGP, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP X))
		      (SUBBAGP X (CDR Y)))
		 (SUBBAGP X Y)).

  This simplifies, unfolding the function SUBBAGP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 4.9679993 0.49900106 ]

SUBBAGP-CDR2 


(PROVE-LEMMA SUBBAGP-BAGINT1
	     (REWRITE)
	     (SUBBAGP (BAGINT X Y) X))

     Call the conjecture *1.


     We will appeal to induction.  There is only one plausible
induction.  We will induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP X)
			 (MEMBER (CAR X) Y)
			 (P (CDR X) (DELETE (CAR X) Y)))
		    (P X Y))
	   (IMPLIES (AND (LISTP X)
			 (NOT (MEMBER (CAR X) Y))
			 (P (CDR X) Y))
		    (P X Y))
	   (IMPLIES (NOT (LISTP X)) (P X Y))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  Note, however, the inductive
instances chosen for Y.  The above induction scheme generates three
new goals:

Case 3. (IMPLIES (AND (LISTP X)
		      (MEMBER (CAR X) Y)
		      (SUBBAGP (BAGINT (CDR X) (DELETE (CAR X) Y))
			       (CDR X)))
		 (SUBBAGP (BAGINT X Y) X)),

  which we simplify, rewriting with CDR-CONS and CAR-CONS, and
  unfolding the definitions of BAGINT, DELETE, MEMBER, and SUBBAGP,
  to:

        T.

Case 2. (IMPLIES (AND (LISTP X)
		      (NOT (MEMBER (CAR X) Y))
		      (SUBBAGP (BAGINT (CDR X) Y) (CDR X)))
		 (SUBBAGP (BAGINT X Y) X)).

  This simplifies, applying SUBBAGP-CDR2, and expanding the function
  BAGINT, to:

        T.

Case 1. (IMPLIES (NOT (LISTP X))
		 (SUBBAGP (BAGINT X Y) X)).

  This simplifies, rewriting with the lemmas CDR-NLISTP and
  SUBBAGP-CDR2, and unfolding the functions BAGINT and SUBBAGP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.42599691 0.209002685 ]

SUBBAGP-BAGINT1 


(PROVE-LEMMA SUBBAGP-BAGINT2
	     (REWRITE)
	     (SUBBAGP (BAGINT X Y) Y))

     Call the conjecture *1.


     We will appeal to induction.  There is only one plausible
induction.  We will induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP X)
			 (MEMBER (CAR X) Y)
			 (P (CDR X) (DELETE (CAR X) Y)))
		    (P X Y))
	   (IMPLIES (AND (LISTP X)
			 (NOT (MEMBER (CAR X) Y))
			 (P (CDR X) Y))
		    (P X Y))
	   (IMPLIES (NOT (LISTP X)) (P X Y))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  Note, however, the inductive
instances chosen for Y.  The above induction scheme generates three
new goals:

Case 3. (IMPLIES (AND (LISTP X)
		      (MEMBER (CAR X) Y)
		      (SUBBAGP (BAGINT (CDR X) (DELETE (CAR X) Y))
			       (DELETE (CAR X) Y)))
		 (SUBBAGP (BAGINT X Y) Y)),

  which we simplify, rewriting with CDR-CONS and CAR-CONS, and
  unfolding the definitions of BAGINT and SUBBAGP, to:

        T.

Case 2. (IMPLIES (AND (LISTP X)
		      (NOT (MEMBER (CAR X) Y))
		      (SUBBAGP (BAGINT (CDR X) Y) Y))
		 (SUBBAGP (BAGINT X Y) Y)).

  This simplifies, expanding the definition of BAGINT, to:

        T.

Case 1. (IMPLIES (NOT (LISTP X))
		 (SUBBAGP (BAGINT X Y) Y)),

  which simplifies, rewriting with SUBBAGP-CDR2, and opening up
  BAGINT, SUBBAGP, and LISTP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.81900126 0.199997965 ]

SUBBAGP-BAGINT2 


(DEFN PLUS-FRINGE
      (X)
      (IF (AND (LISTP X) (EQUAL (CAR X) 'PLUS))
	  (APPEND (PLUS-FRINGE (CADR X))
		  (PLUS-FRINGE (CADDR X)))
	  (CONS X NIL)))
     Linear arithmetic, the lemmas CAR-LESSEQP, CDR-LESSEQP, and
CDR-LESSP, and the definition of AND establish that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each recursive call.  Hence, PLUS-FRINGE is accepted under the
definitional principle.  From the definition we can conclude that
(LISTP (PLUS-FRINGE X)) is a theorem.




[ 1.07400005 0.0549997967 ]

PLUS-FRINGE 


(DEFN PLUS-TREE
      (L)
      (IF (NLISTP L)
	  ''0.
	  (IF (NLISTP (CDR L))
	      (LIST 'FIX (CAR L))
	      (IF (NLISTP (CDDR L))
		  (LIST 'PLUS (CAR L) (CADR L))
		  (LIST 'PLUS
			(CAR L)
			(PLUS-TREE (CDR L)))))))
     Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP can be used to prove that the measure (COUNT L)
decreases according to the well-founded relation LESSP in each
recursive call.  Hence, PLUS-TREE is accepted under the principle of
definition.  Observe that (LISTP (PLUS-TREE L)) is a theorem.




[ 1.09100036 0.0480000814 ]

PLUS-TREE 


(DEFN CANCEL
 (X)
 (IF
  (AND (LISTP X)
       (EQUAL (CAR X) 'EQUAL))
  (IF
     (AND (LISTP (CADR X))
	  (EQUAL (CAADR X) 'PLUS)
	  (LISTP (CADDR X))
	  (EQUAL (CAADDR X) 'PLUS))
     (LIST 'EQUAL
	   (PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADR X))
			       (BAGINT (PLUS-FRINGE (CADR X))
				       (PLUS-FRINGE (CADDR X)))))
	   (PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADDR X))
			       (BAGINT (PLUS-FRINGE (CADR X))
				       (PLUS-FRINGE (CADDR X))))))
     (IF (AND (LISTP (CADR X))
	      (EQUAL (CAADR X) 'PLUS)
	      (MEMBER (CADDR X)
		      (PLUS-FRINGE (CADR X))))
	 (LIST 'IF
	       (LIST 'NUMBERP (CADDR X))
	       (LIST 'EQUAL
		     (PLUS-TREE (DELETE (CADDR X)
					(PLUS-FRINGE (CADR X))))
		     ''0.)
	       (LIST 'QUOTE F))
	 (IF (AND (LISTP (CADDR X))
		  (EQUAL (CAADDR X) 'PLUS)
		  (MEMBER (CADR X)
			  (PLUS-FRINGE (CADDR X))))
	     (LIST 'IF
		   (LIST 'NUMBERP (CADR X))
		   (LIST 'EQUAL
			 ''0.
			 (PLUS-TREE (DELETE (CADR X)
					    (PLUS-FRINGE (CADDR X)))))
		   (LIST 'QUOTE F))
	     X)))
  X))
     Note that (OR (LISTP (CANCEL X)) (EQUAL (CANCEL X) X)) is a
theorem.




[ 2.4200002 0.012000529 ]

CANCEL 


(PROVE-LEMMA FORM-LSTP-APPEND
	     (REWRITE)
	     (IMPLIES (AND (FORM-LSTP A) (FORM-LSTP B))
		      (FORM-LSTP (APPEND A B))))

     Give the conjecture the name *1.


     Let us appeal to the induction principle.  The recursive terms
in the conjecture suggest three inductions.  They merge into two
likely candidate inductions.  However, only one is unflawed.  We will
induct according to the following scheme:
      (AND (IMPLIES (NLISTP A) (P A B))
	   (IMPLIES (AND (NOT (NLISTP A)) (P (CDR A) B))
		    (P A B))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT A) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme generates three new
conjectures:

Case 3. (IMPLIES (AND (NLISTP A)
		      (FORM-LSTP A)
		      (FORM-LSTP B))
		 (FORM-LSTP (APPEND A B))),

  which simplifies, opening up the definitions of NLISTP, FORM-LSTP,
  LISTP, and APPEND, to:

        T.

Case 2. (IMPLIES (AND (NOT (NLISTP A))
		      (NOT (FORM-LSTP (CDR A)))
		      (FORM-LSTP A)
		      (FORM-LSTP B))
		 (FORM-LSTP (APPEND A B))).

  This simplifies, expanding the functions NLISTP and FORM-LSTP, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP A))
		      (FORM-LSTP (APPEND (CDR A) B))
		      (FORM-LSTP A)
		      (FORM-LSTP B))
		 (FORM-LSTP (APPEND A B))),

  which we simplify, applying CDR-CONS and CAR-CONS, and opening up
  NLISTP, FORM-LSTP, and APPEND, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.61700033 0.196000163 ]

FORM-LSTP-APPEND 


(PROVE-LEMMA FORM-LSTP-PLUS-FRINGE
	     (REWRITE)
	     (IMPLIES (FORMP X)
		      (FORM-LSTP (PLUS-FRINGE X))))

     Name the conjecture *1.


     Perhaps we can prove it by induction.  There is only one
plausible induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (AND (AND (LISTP X) (EQUAL (CAR X) 'PLUS))
			 (P (CADDR X))
			 (P (CADR X)))
		    (P X))
	   (IMPLIES (NOT (AND (LISTP X)
			      (EQUAL (CAR X) 'PLUS)))
		    (P X))).
Linear arithmetic, the lemmas CAR-LESSEQP, CDR-LESSEQP, and CDR-LESSP,
and the definition of AND inform us that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each
induction step of the scheme.  The above induction scheme produces
five new formulas:

Case 5. (IMPLIES (AND (AND (LISTP X) (EQUAL (CAR X) 'PLUS))
		      (NOT (FORMP (CADDR X)))
		      (NOT (FORMP (CADR X)))
		      (FORMP X))
		 (FORM-LSTP (PLUS-FRINGE X))).

  This simplifies, opening up the definitions of AND, PLUS-FRINGE,
  and EQUAL, to:

        (IMPLIES (AND (LISTP X)
		      (EQUAL (CAR X) 'PLUS)
		      (NOT (FORMP (CADDR X)))
		      (NOT (FORMP (CADR X)))
		      (FORMP X))
		 (FORM-LSTP (APPEND (PLUS-FRINGE (CADR X))
				    (PLUS-FRINGE (CADDR X))))).

  Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V) to
  eliminate (CAR X) and (CDR X), V by (CONS D W) to eliminate (CDR V)
  and (CAR V), and W by (CONS V C) to eliminate (CAR W) and (CDR W).
  We must thus prove three new goals:

  Case 5.3.
          (IMPLIES (AND (NOT (LISTP V))
			(EQUAL Z 'PLUS)
			(NOT (FORMP (CADR V)))
			(NOT (FORMP (CAR V)))
			(FORMP (CONS Z V)))
		   (FORM-LSTP (APPEND (PLUS-FRINGE (CAR V))
				      (PLUS-FRINGE (CADR V))))).

    However this further simplifies, appealing to the lemmas
    CDR-NLISTP and CAR-NLISTP, and unfolding the definitions of CAR,
    FORMP, SYMBOLP, LENGTH, and EQUAL, to:

          T.

  Case 5.2.
          (IMPLIES (AND (NOT (LISTP W))
			(EQUAL Z 'PLUS)
			(NOT (FORMP (CAR W)))
			(NOT (FORMP D))
			(FORMP (CONS Z (CONS D W))))
		   (FORM-LSTP (APPEND (PLUS-FRINGE D)
				      (PLUS-FRINGE (CAR W))))),

    which we further simplify, rewriting with CAR-NLISTP and CDR-CONS,
    and opening up FORMP, SYMBOLP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 5.1.
          (IMPLIES (AND (EQUAL Z 'PLUS)
			(NOT (FORMP V))
			(NOT (FORMP D))
			(FORMP (CONS Z (CONS D (CONS V C)))))
		   (FORM-LSTP (APPEND (PLUS-FRINGE D)
				      (PLUS-FRINGE V)))),

    which further simplifies, applying CDR-CONS, ADD1-EQUAL, and
    CAR-CONS, and expanding the functions FORMP, LENGTH, NUMBERP, and
    FORM-LSTP, to:

          T.

Case 4. (IMPLIES (AND (AND (LISTP X) (EQUAL (CAR X) 'PLUS))
		      (FORM-LSTP (PLUS-FRINGE (CADDR X)))
		      (NOT (FORMP (CADR X)))
		      (FORMP X))
		 (FORM-LSTP (PLUS-FRINGE X))),

  which we simplify, unfolding the definitions of AND, PLUS-FRINGE,
  and EQUAL, to:

        (IMPLIES (AND (LISTP X)
		      (EQUAL (CAR X) 'PLUS)
		      (FORM-LSTP (PLUS-FRINGE (CADDR X)))
		      (NOT (FORMP (CADR X)))
		      (FORMP X))
		 (FORM-LSTP (APPEND (PLUS-FRINGE (CADR X))
				    (PLUS-FRINGE (CADDR X))))).

  Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V) to
  eliminate (CAR X) and (CDR X), V by (CONS D W) to eliminate (CDR V)
  and (CAR V), and W by (CONS V C) to eliminate (CAR W) and (CDR W).
  The result is the following three new formulas:

  Case 4.3.
          (IMPLIES (AND (NOT (LISTP V))
			(EQUAL Z 'PLUS)
			(FORM-LSTP (PLUS-FRINGE (CADR V)))
			(NOT (FORMP (CAR V)))
			(FORMP (CONS Z V)))
		   (FORM-LSTP (APPEND (PLUS-FRINGE (CAR V))
				      (PLUS-FRINGE (CADR V))))).

    But this simplifies further, rewriting with CDR-NLISTP, and
    expanding the functions CAR, PLUS-FRINGE, SYMBOLP, FORMP, LISTP,
    and FORM-LSTP, to:

          T.

  Case 4.2.
          (IMPLIES (AND (NOT (LISTP W))
			(EQUAL Z 'PLUS)
			(FORM-LSTP (PLUS-FRINGE (CAR W)))
			(NOT (FORMP D))
			(FORMP (CONS Z (CONS D W))))
		   (FORM-LSTP (APPEND (PLUS-FRINGE D)
				      (PLUS-FRINGE (CAR W))))).

    However this simplifies further, rewriting with the lemma
    CAR-NLISTP, and expanding the definitions of PLUS-FRINGE, SYMBOLP,
    FORMP, CAR, LISTP, and FORM-LSTP, to:

          T.

  Case 4.1.
          (IMPLIES (AND (EQUAL Z 'PLUS)
			(FORM-LSTP (PLUS-FRINGE V))
			(NOT (FORMP D))
			(FORMP (CONS Z (CONS D (CONS V C)))))
		   (FORM-LSTP (APPEND (PLUS-FRINGE D)
				      (PLUS-FRINGE V)))).

    However this further simplifies, applying CDR-CONS, ADD1-EQUAL,
    and CAR-CONS, and opening up the definitions of FORMP, LENGTH,
    NUMBERP, and FORM-LSTP, to:

          T.

Case 3. (IMPLIES (AND (AND (LISTP X) (EQUAL (CAR X) 'PLUS))
		      (NOT (FORMP (CADDR X)))
		      (FORM-LSTP (PLUS-FRINGE (CADR X)))
		      (FORMP X))
		 (FORM-LSTP (PLUS-FRINGE X))).

  This simplifies, unfolding the definitions of AND, PLUS-FRINGE, and
  EQUAL, to the conjecture:

        (IMPLIES (AND (LISTP X)
		      (EQUAL (CAR X) 'PLUS)
		      (NOT (FORMP (CADDR X)))
		      (FORM-LSTP (PLUS-FRINGE (CADR X)))
		      (FORMP X))
		 (FORM-LSTP (APPEND (PLUS-FRINGE (CADR X))
				    (PLUS-FRINGE (CADDR X))))).

  Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V) to
  eliminate (CAR X) and (CDR X), V by (CONS D W) to eliminate (CDR V)
  and (CAR V), and W by (CONS V C) to eliminate (CAR W) and (CDR W).
  We would thus like to prove three new conjectures:

  Case 3.3.
          (IMPLIES (AND (NOT (LISTP V))
			(EQUAL Z 'PLUS)
			(NOT (FORMP (CADR V)))
			(FORM-LSTP (PLUS-FRINGE (CAR V)))
			(FORMP (CONS Z V)))
		   (FORM-LSTP (APPEND (PLUS-FRINGE (CAR V))
				      (PLUS-FRINGE (CADR V))))),

    which we further simplify, applying CDR-NLISTP and CAR-NLISTP,
    and opening up the definitions of CAR, FORMP, SYMBOLP,
    PLUS-FRINGE, LISTP, and FORM-LSTP, to:

          T.

  Case 3.2.
          (IMPLIES (AND (NOT (LISTP W))
			(EQUAL Z 'PLUS)
			(NOT (FORMP (CAR W)))
			(FORM-LSTP (PLUS-FRINGE D))
			(FORMP (CONS Z (CONS D W))))
		   (FORM-LSTP (APPEND (PLUS-FRINGE D)
				      (PLUS-FRINGE (CAR W))))),

    which we further simplify, appealing to the lemmas CAR-NLISTP and
    CDR-CONS, and unfolding the functions FORMP, SYMBOLP, LENGTH,
    ADD1, and EQUAL, to:

          T.

  Case 3.1.
          (IMPLIES (AND (EQUAL Z 'PLUS)
			(NOT (FORMP V))
			(FORM-LSTP (PLUS-FRINGE D))
			(FORMP (CONS Z (CONS D (CONS V C)))))
		   (FORM-LSTP (APPEND (PLUS-FRINGE D)
				      (PLUS-FRINGE V)))).

    But this further simplifies, rewriting with the lemmas CDR-CONS,
    ADD1-EQUAL, and CAR-CONS, and expanding the definitions of FORMP,
    LENGTH, NUMBERP, and FORM-LSTP, to:

          T.

Case 2. (IMPLIES (AND (AND (LISTP X) (EQUAL (CAR X) 'PLUS))
		      (FORM-LSTP (PLUS-FRINGE (CADDR X)))
		      (FORM-LSTP (PLUS-FRINGE (CADR X)))
		      (FORMP X))
		 (FORM-LSTP (PLUS-FRINGE X))).

  This simplifies, applying FORM-LSTP-APPEND, and opening up AND,
  PLUS-FRINGE, and EQUAL, to:

        T.

Case 1. (IMPLIES (AND (NOT (AND (LISTP X)
				(EQUAL (CAR X) 'PLUS)))
		      (FORMP X))
		 (FORM-LSTP (PLUS-FRINGE X))),

  which simplifies, applying CDR-CONS and CAR-CONS, and expanding the
  functions AND, PLUS-FRINGE, FORM-LSTP, EQUAL, and LISTP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 3.43900147 0.93199768 ]

FORM-LSTP-PLUS-FRINGE 


(PROVE-LEMMA FORM-LSTP-DELETE
	     (REWRITE)
	     (IMPLIES (FORM-LSTP X)
		      (FORM-LSTP (DELETE Y X))))

     Name the conjecture *1.


     We will try to prove it by induction.  There are two plausible
inductions.  However, they merge into one likely candidate induction.
We will induct according to the following scheme:
      (AND (IMPLIES (NLISTP X) (P Y X))
	   (IMPLIES (AND (NOT (NLISTP X)) (P Y (CDR X)))
		    (P Y X))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme generates the following
three new formulas:

Case 3. (IMPLIES (AND (NLISTP X) (FORM-LSTP X))
		 (FORM-LSTP (DELETE Y X))),

  which simplifies, applying DELETE-NON-MEMBER, and expanding the
  definitions of NLISTP, FORM-LSTP, MEMBER, LISTP, and EQUAL, to:

        T.

Case 2. (IMPLIES (AND (NOT (NLISTP X))
		      (NOT (FORM-LSTP (CDR X)))
		      (FORM-LSTP X))
		 (FORM-LSTP (DELETE Y X))),

  which simplifies, unfolding the functions NLISTP and FORM-LSTP, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP X))
		      (FORM-LSTP (DELETE Y (CDR X)))
		      (FORM-LSTP X))
		 (FORM-LSTP (DELETE Y X))).

  This simplifies, opening up the functions NLISTP, FORM-LSTP, and
  DELETE, to the new conjecture:

        (IMPLIES (AND (LISTP X)
		      (FORM-LSTP (DELETE Y (CDR X)))
		      (FORMP (CAR X))
		      (FORM-LSTP (CDR X))
		      (NOT (EQUAL Y (CAR X))))
		 (FORM-LSTP (CONS (CAR X) (DELETE Y (CDR X))))),

  which we again simplify, rewriting with CDR-CONS and CAR-CONS, and
  opening up FORM-LSTP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.362999473 0.22100118 ]

FORM-LSTP-DELETE 


(PROVE-LEMMA FORM-LSTP-BAGDIFF
	     (REWRITE)
	     (IMPLIES (FORM-LSTP X)
		      (FORM-LSTP (BAGDIFF X Y))))

     Name the conjecture *1.


     We will try to prove it by induction.  There are two plausible
inductions.  However, only one is unflawed.  We will induct according
to the following scheme:
      (AND (IMPLIES (AND (LISTP Y)
			 (MEMBER (CAR Y) X)
			 (P (DELETE (CAR Y) X) (CDR Y)))
		    (P X Y))
	   (IMPLIES (AND (LISTP Y)
			 (NOT (MEMBER (CAR Y) X))
			 (P X (CDR Y)))
		    (P X Y))
	   (IMPLIES (NOT (LISTP Y)) (P X Y))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  Note, however, the inductive
instances chosen for X.  The above induction scheme generates the
following four new formulas:

Case 4. (IMPLIES (AND (LISTP Y)
		      (MEMBER (CAR Y) X)
		      (NOT (FORM-LSTP (DELETE (CAR Y) X)))
		      (FORM-LSTP X))
		 (FORM-LSTP (BAGDIFF X Y))),

  which simplifies, applying FORM-LSTP-DELETE, to:

        T.

Case 3. (IMPLIES (AND (LISTP Y)
		      (MEMBER (CAR Y) X)
		      (FORM-LSTP (BAGDIFF (DELETE (CAR Y) X) (CDR Y)))
		      (FORM-LSTP X))
		 (FORM-LSTP (BAGDIFF X Y))),

  which we simplify, opening up BAGDIFF, to:

        T.

Case 2. (IMPLIES (AND (LISTP Y)
		      (NOT (MEMBER (CAR Y) X))
		      (FORM-LSTP (BAGDIFF X (CDR Y)))
		      (FORM-LSTP X))
		 (FORM-LSTP (BAGDIFF X Y))),

  which we simplify, unfolding BAGDIFF, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP Y)) (FORM-LSTP X))
		 (FORM-LSTP (BAGDIFF X Y))).

  This simplifies, opening up BAGDIFF, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.496000163 0.218000285 ]

FORM-LSTP-BAGDIFF 


(PROVE-LEMMA FORMP-PLUS-TREE
	     (REWRITE)
	     (IMPLIES (FORM-LSTP X)
		      (FORMP (PLUS-TREE X))))

     Name the conjecture *1.


     Perhaps we can prove it by induction.  The recursive terms in
the conjecture suggest two inductions.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (NLISTP X) (P X))
	   (IMPLIES (AND (NOT (NLISTP X))
			 (NLISTP (CDR X)))
		    (P X))
	   (IMPLIES (AND (NOT (NLISTP X))
			 (NOT (NLISTP (CDR X)))
			 (NLISTP (CDDR X)))
		    (P X))
	   (IMPLIES (AND (NOT (NLISTP X))
			 (NOT (NLISTP (CDR X)))
			 (NOT (NLISTP (CDDR X)))
			 (P (CDR X)))
		    (P X))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme produces five new formulas:

Case 5. (IMPLIES (AND (NLISTP X) (FORM-LSTP X))
		 (FORMP (PLUS-TREE X))).

  This simplifies, opening up the definitions of NLISTP, FORM-LSTP,
  PLUS-TREE, FORMP, LISTP, CDR, and EQUAL, to:

        T.

Case 4. (IMPLIES (AND (NOT (NLISTP X))
		      (NLISTP (CDR X))
		      (FORM-LSTP X))
		 (FORMP (PLUS-TREE X))),

  which we simplify, rewriting with the lemmas CDR-CONS and CAR-CONS,
  and unfolding the functions NLISTP, FORM-LSTP, PLUS-TREE, FORMP,
  ADD1, LENGTH, EQUAL, and LISTP, to:

        T.

Case 3. (IMPLIES (AND (NOT (NLISTP X))
		      (NOT (NLISTP (CDR X)))
		      (NLISTP (CDDR X))
		      (FORM-LSTP X))
		 (FORMP (PLUS-TREE X))).

  This simplifies, appealing to the lemmas CDR-CONS and CAR-CONS, and
  opening up NLISTP, FORM-LSTP, PLUS-TREE, FORMP, LENGTH, ADD1, EQUAL,
  and LISTP, to:

        (IMPLIES (AND (LISTP X)
		      (LISTP (CDR X))
		      (NOT (LISTP (CDDR X)))
		      (FORMP (CAR X))
		      (FORM-LSTP (CDR X)))
		 (FORMP (CADR X))),

  which we further simplify, unfolding the function FORM-LSTP, to:

        T.

Case 2. (IMPLIES (AND (NOT (NLISTP X))
		      (NOT (NLISTP (CDR X)))
		      (NOT (NLISTP (CDDR X)))
		      (NOT (FORM-LSTP (CDR X)))
		      (FORM-LSTP X))
		 (FORMP (PLUS-TREE X))),

  which we simplify, expanding the definitions of NLISTP and
  FORM-LSTP, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP X))
		      (NOT (NLISTP (CDR X)))
		      (NOT (NLISTP (CDDR X)))
		      (FORMP (PLUS-TREE (CDR X)))
		      (FORM-LSTP X))
		 (FORMP (PLUS-TREE X))),

  which we simplify, rewriting with CDR-CONS and CAR-CONS, and
  unfolding NLISTP, FORM-LSTP, PLUS-TREE, FORMP, LENGTH, ADD1, EQUAL,
  and LISTP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.6210022 0.345998127 ]

FORMP-PLUS-TREE 


(PROVE-LEMMA NUMBERP-MEANING-PLUS
	     (REWRITE)
	     (IMPLIES (AND (LISTP X) (EQUAL (CAR X) 'PLUS))
		      (NUMBERP (MEANING X A))))
.

Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X).  This produces the new conjecture:

      (IMPLIES (EQUAL Z 'PLUS)
	       (NUMBERP (MEANING (CONS Z V) A))).

However this simplifies, opening up the definition of MEANING, to:

      T.

Q.E.D.


[ 0.234999593 0.0490000406 ]

NUMBERP-MEANING-PLUS 


(PROVE-LEMMA NUMBERP-MEANING-PLUS-TREE
	     (REWRITE)
	     (NUMBERP (MEANING (PLUS-TREE L) A)))

     Give the conjecture the name *1.


     We will try to prove it by induction.  There is only one
plausible induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (NLISTP L) (P L A))
	   (IMPLIES (AND (NOT (NLISTP L))
			 (NLISTP (CDR L)))
		    (P L A))
	   (IMPLIES (AND (NOT (NLISTP L))
			 (NOT (NLISTP (CDR L)))
			 (NLISTP (CDDR L)))
		    (P L A))
	   (IMPLIES (AND (NOT (NLISTP L))
			 (NOT (NLISTP (CDR L)))
			 (NOT (NLISTP (CDDR L)))
			 (P (CDR L) A))
		    (P L A))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP establish that the measure (COUNT L) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme leads to the following
four new goals:

Case 4. (IMPLIES (NLISTP L)
		 (NUMBERP (MEANING (PLUS-TREE L) A))),

  which simplifies, unfolding the definitions of NLISTP, PLUS-TREE,
  MEANING, CAR, and NUMBERP, to:

        T.

Case 3. (IMPLIES (AND (NOT (NLISTP L))
		      (NLISTP (CDR L)))
		 (NUMBERP (MEANING (PLUS-TREE L) A))).

  This simplifies, applying CAR-CONS, and expanding the functions
  NLISTP, PLUS-TREE, MEANING, and FIX, to:

        T.

Case 2. (IMPLIES (AND (NOT (NLISTP L))
		      (NOT (NLISTP (CDR L)))
		      (NLISTP (CDDR L)))
		 (NUMBERP (MEANING (PLUS-TREE L) A))).

  This simplifies, rewriting with the lemmas CAR-CONS and CDR-CONS,
  and unfolding the functions NLISTP, PLUS-TREE, and MEANING, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP L))
		      (NOT (NLISTP (CDR L)))
		      (NOT (NLISTP (CDDR L)))
		      (NUMBERP (MEANING (PLUS-TREE (CDR L)) A)))
		 (NUMBERP (MEANING (PLUS-TREE L) A))).

  This simplifies, rewriting with CAR-CONS and CDR-CONS, and
  expanding NLISTP, PLUS-TREE, and MEANING, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.355000813 0.258999635 ]

NUMBERP-MEANING-PLUS-TREE 


(PROVE-LEMMA MEMBER-IMPLIES-PLUS-TREE-GREATEREQP
	     (REWRITE)
	     (IMPLIES (MEMBER X Y)
		      ( LEQ
			(MEANING X A)
			(MEANING (PLUS-TREE Y) A))))

WARNING:  When the linear lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP
is stored under (MEANING (PLUS-TREE Y) A) it contains the free
variable X which will be chosen by instantiating the hypothesis
(MEMBER X Y).


WARNING:  When the linear lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP
is stored under (MEANING X A) it contains the free variable Y which
will be chosen by instantiating the hypothesis (MEMBER X Y).


     Name the conjecture *1.


     We will try to prove it by induction.  Two inductions are
suggested by terms in the conjecture.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (NLISTP Y) (P Y A X))
	   (IMPLIES (AND (NOT (NLISTP Y))
			 (EQUAL X (CAR Y)))
		    (P Y A X))
	   (IMPLIES (AND (NOT (NLISTP Y))
			 (NOT (EQUAL X (CAR Y)))
			 (P (CDR Y) A X))
		    (P Y A X))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP can be used to prove that the measure (COUNT Y)
decreases according to the well-founded relation LESSP in each
induction step of the scheme.  The above induction scheme produces
four new formulas:

Case 4. (IMPLIES (AND (NLISTP Y) (MEMBER X Y))
		 ( LEQ
		   (MEANING X A)
		   (MEANING (PLUS-TREE Y) A))).

  This simplifies, opening up the definitions of NLISTP and MEMBER,
  to:

        T.

Case 3. (IMPLIES (AND (NOT (NLISTP Y))
		      (EQUAL X (CAR Y))
		      (MEMBER X Y))
		 ( LEQ
		   (MEANING X A)
		   (MEANING (PLUS-TREE Y) A))),

  which we simplify, opening up NLISTP, MEMBER, and PLUS-TREE, to
  three new goals:

  Case 3.3.
          (IMPLIES (AND (LISTP Y) (NOT (LISTP (CDR Y))))
		   ( LEQ
		     (MEANING (CAR Y) A)
		     (MEANING (LIST 'FIX (CAR Y)) A))).

    However this again simplifies, appealing to the lemma CAR-CONS,
    and unfolding the definitions of MEANING and FIX, to two new
    conjectures:

    Case 3.3.2.
            (IMPLIES (AND (LISTP Y)
			  (NOT (LISTP (CDR Y)))
			  (NOT (NUMBERP (MEANING (CAR Y) A))))
		     ( LEQ (MEANING (CAR Y) A) 0)),

      which we again simplify, unfolding the definition of LESSP, to:

            T.

    Case 3.3.1.
            (IMPLIES (AND (LISTP Y)
			  (NOT (LISTP (CDR Y)))
			  (NUMBERP (MEANING (CAR Y) A)))
		     ( LEQ
		       (MEANING (CAR Y) A)
		       (MEANING (CAR Y) A))).

      This simplifies again, using linear arithmetic, to:

            T.

  Case 3.2.
          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			(LISTP (CDDR Y)))
		   ( LEQ
		     (MEANING (CAR Y) A)
		     (MEANING (LIST 'PLUS
				    (CAR Y)
				    (PLUS-TREE (CDR Y)))
			      A))),

    which we again simplify, rewriting with CAR-CONS and CDR-CONS,
    and unfolding the definition of MEANING, to:

          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			(LISTP (CDDR Y)))
		   ( LEQ
		     (MEANING (CAR Y) A)
		     (PLUS (MEANING (CAR Y) A)
			   (MEANING (PLUS-TREE (CDR Y)) A)))),

    which we again simplify, using linear arithmetic, to:

          T.

  Case 3.1.
          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			(NOT (LISTP (CDDR Y))))
		   ( LEQ
		     (MEANING (CAR Y) A)
		     (MEANING (LIST 'PLUS (CAR Y) (CADR Y))
			      A))).

    But this simplifies again, applying CAR-CONS and CDR-CONS, and
    opening up MEANING, to:

          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			(NOT (LISTP (CDDR Y))))
		   ( LEQ
		     (MEANING (CAR Y) A)
		     (PLUS (MEANING (CAR Y) A)
			   (MEANING (CADR Y) A)))),

    which we again simplify, using linear arithmetic, to:

          T.

Case 2. (IMPLIES (AND (NOT (NLISTP Y))
		      (NOT (EQUAL X (CAR Y)))
		      (NOT (MEMBER X (CDR Y)))
		      (MEMBER X Y))
		 ( LEQ
		   (MEANING X A)
		   (MEANING (PLUS-TREE Y) A))).

  This simplifies, unfolding the functions NLISTP and MEMBER, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP Y))
		      (NOT (EQUAL X (CAR Y)))
		      ( LEQ
			(MEANING X A)
			(MEANING (PLUS-TREE (CDR Y)) A))
		      (MEMBER X Y))
		 ( LEQ
		   (MEANING X A)
		   (MEANING (PLUS-TREE Y) A))).

  This simplifies, expanding the functions NLISTP, MEMBER, and
  PLUS-TREE, to three new conjectures:

  Case 1.3.
          (IMPLIES (AND (LISTP Y)
			(NOT (EQUAL X (CAR Y)))
			( LEQ
			  (MEANING X A)
			  (MEANING (PLUS-TREE (CDR Y)) A))
			(MEMBER X (CDR Y))
			(NOT (LISTP (CDR Y))))
		   ( LEQ
		     (MEANING X A)
		     (MEANING (LIST 'FIX (CAR Y)) A))),

    which again simplifies, applying CAR-CONS, and opening up the
    functions MEANING and FIX, to the following two new conjectures:

    Case 1.3.2.
            (IMPLIES (AND (LISTP Y)
			  (NOT (EQUAL X (CAR Y)))
			  ( LEQ
			    (MEANING X A)
			    (MEANING (PLUS-TREE (CDR Y)) A))
			  (MEMBER X (CDR Y))
			  (NOT (LISTP (CDR Y)))
			  (NOT (NUMBERP (MEANING (CAR Y) A))))
		     ( LEQ (MEANING X A) 0)),

      which again simplifies, expanding the functions EQUAL and LESSP,
      to:

            (IMPLIES (AND (LISTP Y)
			  (NOT (EQUAL X (CAR Y)))
			  ( LEQ
			    (MEANING X A)
			    (MEANING (PLUS-TREE (CDR Y)) A))
			  (MEMBER X (CDR Y))
			  (NOT (LISTP (CDR Y)))
			  (NOT (NUMBERP (MEANING (CAR Y) A)))
			  (NOT (EQUAL (MEANING X A) 0)))
		     (NOT (NUMBERP (MEANING X A)))),

      which we further simplify, expanding the functions PLUS-TREE,
      MEANING, CAR, EQUAL, and LESSP, to:

            T.

    Case 1.3.1.
            (IMPLIES (AND (LISTP Y)
			  (NOT (EQUAL X (CAR Y)))
			  ( LEQ
			    (MEANING X A)
			    (MEANING (PLUS-TREE (CDR Y)) A))
			  (MEMBER X (CDR Y))
			  (NOT (LISTP (CDR Y)))
			  (NUMBERP (MEANING (CAR Y) A)))
		     ( LEQ
		       (MEANING X A)
		       (MEANING (CAR Y) A))),

      which we further simplify, opening up the definitions of
      PLUS-TREE, MEANING, CAR, EQUAL, LESSP, and MEMBER, to:

            T.

  Case 1.2.
          (IMPLIES (AND (LISTP Y)
			(NOT (EQUAL X (CAR Y)))
			( LEQ
			  (MEANING X A)
			  (MEANING (PLUS-TREE (CDR Y)) A))
			(MEMBER X (CDR Y))
			(LISTP (CDR Y))
			(LISTP (CDDR Y)))
		   ( LEQ
		     (MEANING X A)
		     (MEANING (LIST 'PLUS
				    (CAR Y)
				    (PLUS-TREE (CDR Y)))
			      A))),

    which we again simplify, appealing to the lemmas CAR-CONS and
    CDR-CONS, and unfolding the function MEANING, to:

          (IMPLIES (AND (LISTP Y)
			(NOT (EQUAL X (CAR Y)))
			( LEQ
			  (MEANING X A)
			  (MEANING (PLUS-TREE (CDR Y)) A))
			(MEMBER X (CDR Y))
			(LISTP (CDR Y))
			(LISTP (CDDR Y)))
		   ( LEQ
		     (MEANING X A)
		     (PLUS (MEANING (CAR Y) A)
			   (MEANING (PLUS-TREE (CDR Y)) A)))),

    which again simplifies, using linear arithmetic, to:

          T.

  Case 1.1.
          (IMPLIES (AND (LISTP Y)
			(NOT (EQUAL X (CAR Y)))
			( LEQ
			  (MEANING X A)
			  (MEANING (PLUS-TREE (CDR Y)) A))
			(MEMBER X (CDR Y))
			(LISTP (CDR Y))
			(NOT (LISTP (CDDR Y))))
		   ( LEQ
		     (MEANING X A)
		     (MEANING (LIST 'PLUS (CAR Y) (CADR Y))
			      A))),

    which we again simplify, applying CAR-CONS and CDR-CONS, and
    expanding MEANING, to:

          (IMPLIES (AND (LISTP Y)
			(NOT (EQUAL X (CAR Y)))
			( LEQ
			  (MEANING X A)
			  (MEANING (PLUS-TREE (CDR Y)) A))
			(MEMBER X (CDR Y))
			(LISTP (CDR Y))
			(NOT (LISTP (CDDR Y))))
		   ( LEQ
		     (MEANING X A)
		     (PLUS (MEANING (CAR Y) A)
			   (MEANING (CADR Y) A)))).

    But this further simplifies, applying CAR-CONS and PLUS-RIGHT-ID2,
    and opening up the definitions of PLUS-TREE, MEANING, and FIX, to
    two new goals:

    Case 1.1.2.
            (IMPLIES (AND (LISTP Y)
			  (NOT (EQUAL X (CAR Y)))
			  (NOT (NUMBERP (MEANING (CADR Y) A)))
			  ( LEQ (MEANING X A) 0)
			  (MEMBER X (CDR Y))
			  (LISTP (CDR Y))
			  (NOT (LISTP (CDDR Y)))
			  (NUMBERP (MEANING (CAR Y) A)))
		     ( LEQ
		       (MEANING X A)
		       (MEANING (CAR Y) A))),

      which again simplifies, using linear arithmetic, to:

            T.

    Case 1.1.1.
            (IMPLIES (AND (LISTP Y)
			  (NOT (EQUAL X (CAR Y)))
			  (NUMBERP (MEANING (CADR Y) A))
			  ( LEQ
			    (MEANING X A)
			    (MEANING (CADR Y) A))
			  (MEMBER X (CDR Y))
			  (LISTP (CDR Y))
			  (NOT (LISTP (CDDR Y))))
		     ( LEQ
		       (MEANING X A)
		       (PLUS (MEANING (CAR Y) A)
			     (MEANING (CADR Y) A)))).

      But this again simplifies, using linear arithmetic, to:

            T.


     That finishes the proof of *1.  Q.E.D.


[ 2.65800172 0.91699931 ]

MEMBER-IMPLIES-PLUS-TREE-GREATEREQP 


(PROVE-LEMMA PLUS-TREE-DELETE
	     (REWRITE)
	     (EQUAL (MEANING (PLUS-TREE (DELETE X Y)) A)
		    (IF (MEMBER X Y)
			(DIFFERENCE (MEANING (PLUS-TREE Y) A)
				    (MEANING X A))
			(MEANING (PLUS-TREE Y) A))))
This formula simplifies, trivially, to the following two new goals:

Case 2. (IMPLIES (NOT (MEMBER X Y))
		 (EQUAL (MEANING (PLUS-TREE (DELETE X Y)) A)
			(MEANING (PLUS-TREE Y) A))),

  which again simplifies, applying the lemma DELETE-NON-MEMBER, to:

        T.

Case 1. (IMPLIES (MEMBER X Y)
		 (EQUAL (MEANING (PLUS-TREE (DELETE X Y)) A)
			(DIFFERENCE (MEANING (PLUS-TREE Y) A)
				    (MEANING X A)))),

  which we will name *1.


     Perhaps we can prove it by induction.  The recursive terms in
the conjecture suggest three inductions.  However, they merge into
one likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (NLISTP Y) (P X Y A))
	   (IMPLIES (AND (NOT (NLISTP Y))
			 (EQUAL X (CAR Y)))
		    (P X Y A))
	   (IMPLIES (AND (NOT (NLISTP Y))
			 (NOT (EQUAL X (CAR Y)))
			 (P X (CDR Y) A))
		    (P X Y A))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT Y) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme produces four new formulas:

Case 4. (IMPLIES (AND (NLISTP Y) (MEMBER X Y))
		 (EQUAL (MEANING (PLUS-TREE (DELETE X Y)) A)
			(DIFFERENCE (MEANING (PLUS-TREE Y) A)
				    (MEANING X A)))).

  This simplifies, opening up the definitions of NLISTP and MEMBER,
  to:

        T.

Case 3. (IMPLIES (AND (NOT (NLISTP Y))
		      (EQUAL X (CAR Y))
		      (MEMBER X Y))
		 (EQUAL (MEANING (PLUS-TREE (DELETE X Y)) A)
			(DIFFERENCE (MEANING (PLUS-TREE Y) A)
				    (MEANING X A)))),

  which we simplify, opening up NLISTP, MEMBER, DELETE, and PLUS-TREE,
  to three new goals:

  Case 3.3.
          (IMPLIES (AND (LISTP Y) (NOT (LISTP (CDR Y))))
		   (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
			  (DIFFERENCE (MEANING (LIST 'FIX (CAR Y)) A)
				      (MEANING (CAR Y) A)))).

    However this again simplifies, appealing to the lemma CAR-CONS,
    and unfolding the definitions of MEANING and FIX, to two new
    conjectures:

    Case 3.3.2.
            (IMPLIES (AND (LISTP Y)
			  (NOT (LISTP (CDR Y)))
			  (NOT (NUMBERP (MEANING (CAR Y) A))))
		     (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
			    (DIFFERENCE 0 (MEANING (CAR Y) A)))),

      which we again simplify, using linear arithmetic and rewriting
      with DIFFERENCE-0, to:

            (IMPLIES (AND (LISTP Y)
			  (NOT (LISTP (CDR Y)))
			  (NOT (NUMBERP (MEANING (CAR Y) A))))
		     (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
			    0)).

      This simplifies further, opening up PLUS-TREE, MEANING, CAR,
      and EQUAL, to:

            T.

    Case 3.3.1.
            (IMPLIES (AND (LISTP Y)
			  (NOT (LISTP (CDR Y)))
			  (NUMBERP (MEANING (CAR Y) A)))
		     (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
			    (DIFFERENCE (MEANING (CAR Y) A)
					(MEANING (CAR Y) A)))),

      which again simplifies, using linear arithmetic and applying
      DIFFERENCE-0, to:

            (IMPLIES (AND (LISTP Y)
			  (NOT (LISTP (CDR Y)))
			  (NUMBERP (MEANING (CAR Y) A)))
		     (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
			    0)),

      which we further simplify, expanding the functions PLUS-TREE,
      MEANING, CAR, and EQUAL, to:

            T.

  Case 3.2.
          (IMPLIES
		(AND (LISTP Y)
		     (LISTP (CDR Y))
		     (LISTP (CDDR Y)))
		(EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
		       (DIFFERENCE (MEANING (LIST 'PLUS
						  (CAR Y)
						  (PLUS-TREE (CDR Y)))
					    A)
				   (MEANING (CAR Y) A)))),

    which again simplifies, rewriting with the lemmas CAR-CONS,
    CDR-CONS, NUMBERP-MEANING-PLUS-TREE, and DIFFERENCE-PLUS, and
    unfolding the definition of MEANING, to:

          T.

  Case 3.1.
          (IMPLIES
	    (AND (LISTP Y)
		 (LISTP (CDR Y))
		 (NOT (LISTP (CDDR Y))))
	    (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
		   (DIFFERENCE (MEANING (LIST 'PLUS (CAR Y) (CADR Y))
					A)
			       (MEANING (CAR Y) A)))),

    which again simplifies, rewriting with CAR-CONS, CDR-CONS, and
    DIFFERENCE-PLUS, and unfolding the function MEANING, to the
    following two new conjectures:

    Case 3.1.2.
            (IMPLIES (AND (LISTP Y)
			  (LISTP (CDR Y))
			  (NOT (LISTP (CDDR Y)))
			  (NOT (NUMBERP (MEANING (CADR Y) A))))
		     (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
			    0)),

      which further simplifies, rewriting with CAR-CONS, and
      expanding the definitions of PLUS-TREE, MEANING, FIX, and EQUAL,
      to:

            T.

    Case 3.1.1.
            (IMPLIES (AND (LISTP Y)
			  (LISTP (CDR Y))
			  (NOT (LISTP (CDDR Y)))
			  (NUMBERP (MEANING (CADR Y) A)))
		     (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
			    (MEANING (CADR Y) A))).

      This further simplifies, rewriting with the lemma CAR-CONS, and
      expanding the functions PLUS-TREE, MEANING, and FIX, to:

            T.

Case 2. (IMPLIES (AND (NOT (NLISTP Y))
		      (NOT (EQUAL X (CAR Y)))
		      (NOT (MEMBER X (CDR Y)))
		      (MEMBER X Y))
		 (EQUAL (MEANING (PLUS-TREE (DELETE X Y)) A)
			(DIFFERENCE (MEANING (PLUS-TREE Y) A)
				    (MEANING X A)))).

  This simplifies, opening up the definitions of NLISTP and MEMBER,
  to:

        T.

Case 1. (IMPLIES
	       (AND (NOT (NLISTP Y))
		    (NOT (EQUAL X (CAR Y)))
		    (EQUAL (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				    A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X Y))
	       (EQUAL (MEANING (PLUS-TREE (DELETE X Y)) A)
		      (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				  (MEANING X A)))),

  which we simplify, applying CAR-CONS and CDR-CONS, and opening up
  the functions NLISTP, MEMBER, DELETE, and PLUS-TREE, to nine new
  goals:

  Case 1.9.
          (IMPLIES
	       (AND (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    (EQUAL (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				    A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X (CDR Y))
		    (NOT (LISTP (CDR Y)))
		    (NOT (LISTP (DELETE X (CDR Y)))))
	       (EQUAL (MEANING (LIST 'FIX (CAR Y)) A)
		      (DIFFERENCE (MEANING (LIST 'FIX (CAR Y)) A)
				  (MEANING X A)))),

    which we again simplify, rewriting with EQUAL-DIFFERENCE-0,
    CAR-CONS, and DIFFERENCE-CANCELLATION-0, and opening up the
    functions PLUS-TREE, MEANING, CAR, and FIX, to:

          (IMPLIES (AND (LISTP Y)
			(NOT (EQUAL X (CAR Y)))
			( LEQ
			  (MEANING (PLUS-TREE (CDR Y)) A)
			  (MEANING X A))
			(MEMBER X (CDR Y))
			(NOT (LISTP (CDR Y)))
			(NOT (LISTP (DELETE X (CDR Y))))
			(NUMBERP (MEANING (CAR Y) A))
			(NOT (EQUAL (MEANING (CAR Y) A) 0))
			(NOT (EQUAL (MEANING X A) 0)))
		   (NOT (NUMBERP (MEANING X A)))).

    This simplifies again, using linear arithmetic and applying
    MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to two new formulas:

    Case 1.9.2.
            (IMPLIES
		  (AND (NOT (NUMBERP (MEANING (PLUS-TREE (CDR Y)) A)))
		       (LISTP Y)
		       (NOT (EQUAL X (CAR Y)))
		       ( LEQ
			 (MEANING (PLUS-TREE (CDR Y)) A)
			 (MEANING X A))
		       (MEMBER X (CDR Y))
		       (NOT (LISTP (CDR Y)))
		       (NOT (LISTP (DELETE X (CDR Y))))
		       (NUMBERP (MEANING (CAR Y) A))
		       (NOT (EQUAL (MEANING (CAR Y) A) 0))
		       (NOT (EQUAL (MEANING X A) 0)))
		  (NOT (NUMBERP (MEANING X A)))).

      This again simplifies, using linear arithmetic and applying
      MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

            T.

    Case 1.9.1.
            (IMPLIES (AND (NUMBERP (MEANING (PLUS-TREE (CDR Y)) A))
			  (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
				 (MEANING X A))
			  (LISTP Y)
			  (NOT (EQUAL X (CAR Y)))
			  ( LEQ (MEANING X A) (MEANING X A))
			  (MEMBER X (CDR Y))
			  (NOT (LISTP (CDR Y)))
			  (NOT (LISTP (DELETE X (CDR Y))))
			  (NUMBERP (MEANING (CAR Y) A))
			  (NOT (EQUAL (MEANING (CAR Y) A) 0))
			  (NOT (EQUAL (MEANING X A) 0)))
		     (NOT (NUMBERP (MEANING X A)))).

      This again simplifies, clearly, to the new conjecture:

            (IMPLIES (AND (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
				 (MEANING X A))
			  (LISTP Y)
			  (NOT (EQUAL X (CAR Y)))
			  ( LEQ (MEANING X A) (MEANING X A))
			  (MEMBER X (CDR Y))
			  (NOT (LISTP (CDR Y)))
			  (NOT (LISTP (DELETE X (CDR Y))))
			  (NUMBERP (MEANING (CAR Y) A))
			  (NOT (EQUAL (MEANING (CAR Y) A) 0))
			  (NOT (EQUAL (MEANING X A) 0)))
		     (NOT (NUMBERP (MEANING X A)))),

      which we further simplify, using linear arithmetic, applying
      MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, and opening up the
      functions CAR, MEANING, and PLUS-TREE, to:

            T.

  Case 1.8.
          (IMPLIES
	       (AND (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    (EQUAL (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				    A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X (CDR Y))
		    (NOT (LISTP (CDR Y)))
		    (LISTP (DELETE X (CDR Y)))
		    (LISTP (CDR (DELETE X (CDR Y)))))
	       (EQUAL (MEANING (LIST 'PLUS
				     (CAR Y)
				     (PLUS-TREE (DELETE X (CDR Y))))
			       A)
		      (DIFFERENCE (MEANING (LIST 'FIX (CAR Y)) A)
				  (MEANING X A)))).

    However this again simplifies, applying CAR-CONS and CDR-CONS,
    and unfolding MEANING and FIX, to the following two new goals:

    Case 1.8.2.
            (IMPLIES
	       (AND (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    (EQUAL (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				    A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X (CDR Y))
		    (NOT (LISTP (CDR Y)))
		    (LISTP (DELETE X (CDR Y)))
		    (LISTP (CDR (DELETE X (CDR Y))))
		    (NOT (NUMBERP (MEANING (CAR Y) A))))
	       (EQUAL (PLUS (MEANING (CAR Y) A)
			    (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				     A))
		      (DIFFERENCE 0 (MEANING X A)))).

      However this simplifies again, using linear arithmetic,
      rewriting with the lemma DIFFERENCE-0, and unfolding the
      definition of PLUS, to the new formula:

            (IMPLIES
	       (AND (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    (EQUAL (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				    A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X (CDR Y))
		    (NOT (LISTP (CDR Y)))
		    (LISTP (DELETE X (CDR Y)))
		    (LISTP (CDR (DELETE X (CDR Y))))
		    (NOT (NUMBERP (MEANING (CAR Y) A))))
	       (EQUAL (MEANING (PLUS-TREE (DELETE X (CDR Y)))
			       A)
		      0)).

      But this further simplifies, using linear arithmetic, rewriting
      with DIFFERENCE-0, and expanding DELETE, PLUS-TREE, MEANING,
      CAR, EQUAL, and MEMBER, to:

            T.

    Case 1.8.1.
            (IMPLIES
	       (AND (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    (EQUAL (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				    A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X (CDR Y))
		    (NOT (LISTP (CDR Y)))
		    (LISTP (DELETE X (CDR Y)))
		    (LISTP (CDR (DELETE X (CDR Y))))
		    (NUMBERP (MEANING (CAR Y) A)))
	       (EQUAL (PLUS (MEANING (CAR Y) A)
			    (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				     A))
		      (DIFFERENCE (MEANING (CAR Y) A)
				  (MEANING X A)))).

      But this further simplifies, using linear arithmetic, rewriting
      with DIFFERENCE-0, and expanding the definitions of DELETE,
      PLUS-TREE, MEANING, CAR, EQUAL, and MEMBER, to:

            T.

  Case 1.7.
          (IMPLIES
	       (AND (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    (EQUAL (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				    A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X (CDR Y))
		    (NOT (LISTP (CDR Y)))
		    (LISTP (DELETE X (CDR Y)))
		    (NOT (LISTP (CDR (DELETE X (CDR Y))))))
	       (EQUAL (MEANING (LIST 'PLUS
				     (CAR Y)
				     (CAR (DELETE X (CDR Y))))
			       A)
		      (DIFFERENCE (MEANING (LIST 'FIX (CAR Y)) A)
				  (MEANING X A)))),

    which we again simplify, rewriting with CAR-CONS, CDR-CONS,
    PLUS-RIGHT-ID2, and DIFFERENCE-CANCELLATION-0, and unfolding the
    definitions of PLUS-TREE, MEANING, and FIX, to three new formulas:

    Case 1.7.3.
            (IMPLIES
	     (AND (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  (EQUAL 0
			 (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				     (MEANING X A)))
		  (MEMBER X (CDR Y))
		  (NOT (LISTP (CDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NUMBERP (MEANING (CAR Y) A))
		  (NOT (EQUAL (MEANING (CAR Y) A) 0))
		  (NOT (EQUAL (MEANING X A) 0)))
	     (NOT (NUMBERP (MEANING X A)))),

      which again simplifies, rewriting with EQUAL-DIFFERENCE-0, to
      the formula:

            (IMPLIES
	     (AND (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  ( LEQ
		    (MEANING (PLUS-TREE (CDR Y)) A)
		    (MEANING X A))
		  (MEMBER X (CDR Y))
		  (NOT (LISTP (CDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NUMBERP (MEANING (CAR Y) A))
		  (NOT (EQUAL (MEANING (CAR Y) A) 0))
		  (NOT (EQUAL (MEANING X A) 0)))
	     (NOT (NUMBERP (MEANING X A)))),

      which again simplifies, using linear arithmetic and applying
      MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to two new conjectures:

      Case 1.7.3.2.
              (IMPLIES
	       (AND
		  (NOT (NUMBERP (MEANING (PLUS-TREE (CDR Y)) A)))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  ( LEQ
		    (MEANING (PLUS-TREE (CDR Y)) A)
		    (MEANING X A))
		  (MEMBER X (CDR Y))
		  (NOT (LISTP (CDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NUMBERP (MEANING (CAR Y) A))
		  (NOT (EQUAL (MEANING (CAR Y) A) 0))
		  (NOT (EQUAL (MEANING X A) 0)))
	       (NOT (NUMBERP (MEANING X A)))).

        But this again simplifies, using linear arithmetic and
        appealing to the lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP,
        to:

              T.

      Case 1.7.3.1.
              (IMPLIES
	       (AND
		  (NUMBERP (MEANING (PLUS-TREE (CDR Y)) A))
		  (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
			 (MEANING X A))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  ( LEQ (MEANING X A) (MEANING X A))
		  (MEMBER X (CDR Y))
		  (NOT (LISTP (CDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NUMBERP (MEANING (CAR Y) A))
		  (NOT (EQUAL (MEANING (CAR Y) A) 0))
		  (NOT (EQUAL (MEANING X A) 0)))
	       (NOT (NUMBERP (MEANING X A)))).

        Of course, this again simplifies, obviously, to:

              (IMPLIES
	       (AND
		  (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
			 (MEANING X A))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  ( LEQ (MEANING X A) (MEANING X A))
		  (MEMBER X (CDR Y))
		  (NOT (LISTP (CDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NUMBERP (MEANING (CAR Y) A))
		  (NOT (EQUAL (MEANING (CAR Y) A) 0))
		  (NOT (EQUAL (MEANING X A) 0)))
	       (NOT (NUMBERP (MEANING X A)))),

        which finally simplifies, using linear arithmetic, appealing
        to the lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, and opening
        up the functions CAR, MEANING, and PLUS-TREE, to:

              T.

    Case 1.7.2.
            (IMPLIES
	       (AND (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A))
		    (EQUAL (MEANING (CAR (DELETE X (CDR Y))) A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X (CDR Y))
		    (NOT (LISTP (CDR Y)))
		    (LISTP (DELETE X (CDR Y)))
		    (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		    (NOT (NUMBERP (MEANING (CAR Y) A))))
	       (EQUAL (PLUS (MEANING (CAR Y) A)
			    (MEANING (CAR (DELETE X (CDR Y))) A))
		      (DIFFERENCE 0 (MEANING X A)))).

      However this simplifies again, using linear arithmetic,
      rewriting with DIFFERENCE-0, and opening up PLUS, to:

            (IMPLIES
	       (AND (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    (EQUAL (MEANING (CAR (DELETE X (CDR Y))) A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X (CDR Y))
		    (NOT (LISTP (CDR Y)))
		    (LISTP (DELETE X (CDR Y)))
		    (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		    (NOT (NUMBERP (MEANING (CAR Y) A))))
	       (EQUAL (MEANING (CAR (DELETE X (CDR Y))) A)
		      0)).

      This further simplifies, using linear arithmetic, rewriting
      with CAR-NLISTP and DIFFERENCE-0, and unfolding the functions
      DELETE, MEANING, PLUS-TREE, CAR, and MEMBER, to:

            T.

    Case 1.7.1.
            (IMPLIES
	       (AND (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A))
		    (EQUAL (MEANING (CAR (DELETE X (CDR Y))) A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X (CDR Y))
		    (NOT (LISTP (CDR Y)))
		    (LISTP (DELETE X (CDR Y)))
		    (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		    (NUMBERP (MEANING (CAR Y) A)))
	       (EQUAL (PLUS (MEANING (CAR Y) A)
			    (MEANING (CAR (DELETE X (CDR Y))) A))
		      (DIFFERENCE (MEANING (CAR Y) A)
				  (MEANING X A)))),

      which again simplifies, obviously, to:

            (IMPLIES
	       (AND (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    (EQUAL (MEANING (CAR (DELETE X (CDR Y))) A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X (CDR Y))
		    (NOT (LISTP (CDR Y)))
		    (LISTP (DELETE X (CDR Y)))
		    (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		    (NUMBERP (MEANING (CAR Y) A)))
	       (EQUAL (PLUS (MEANING (CAR Y) A)
			    (MEANING (CAR (DELETE X (CDR Y))) A))
		      (DIFFERENCE (MEANING (CAR Y) A)
				  (MEANING X A)))),

      which further simplifies, using linear arithmetic, applying the
      lemmas CAR-NLISTP and DIFFERENCE-0, and expanding the functions
      DELETE, MEANING, PLUS-TREE, CAR, and MEMBER, to:

            T.

  Case 1.6.
          (IMPLIES
	       (AND (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    (EQUAL (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				    A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X (CDR Y))
		    (LISTP (CDR Y))
		    (LISTP (CDDR Y))
		    (NOT (LISTP (DELETE X (CDR Y)))))
	       (EQUAL (MEANING (LIST 'FIX (CAR Y)) A)
		      (DIFFERENCE (MEANING (LIST 'PLUS
						 (CAR Y)
						 (PLUS-TREE (CDR Y)))
					   A)
				  (MEANING X A)))).

    However this simplifies again, rewriting with the lemmas
    EQUAL-DIFFERENCE-0, CAR-CONS, and CDR-CONS, and expanding
    PLUS-TREE, MEANING, CAR, and FIX, to two new conjectures:

    Case 1.6.2.
            (IMPLIES
	     (AND (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  ( LEQ
		    (MEANING (PLUS-TREE (CDR Y)) A)
		    (MEANING X A))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (LISTP (CDDR Y))
		  (NOT (LISTP (DELETE X (CDR Y))))
		  (NOT (NUMBERP (MEANING (CAR Y) A))))
	     (EQUAL 0
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (PLUS-TREE (CDR Y)) A))
				(MEANING X A)))),

      which again simplifies, using linear arithmetic and applying
      the lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to three new
      goals:

      Case 1.6.2.3.
              (IMPLIES
	       (AND (NOT (NUMBERP (MEANING (PLUS-TREE (CDR Y)) A)))
		    (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    ( LEQ
		      (MEANING (PLUS-TREE (CDR Y)) A)
		      (MEANING X A))
		    (MEMBER X (CDR Y))
		    (LISTP (CDR Y))
		    (LISTP (CDDR Y))
		    (NOT (LISTP (DELETE X (CDR Y))))
		    (NOT (NUMBERP (MEANING (CAR Y) A))))
	       (EQUAL 0
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (PLUS-TREE (CDR Y)) A))
				(MEANING X A)))),

        which again simplifies, rewriting with
        NUMBERP-MEANING-PLUS-TREE, to:

              T.

      Case 1.6.2.2.
              (IMPLIES
	       (AND (NOT (NUMBERP (MEANING X A)))
		    (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    ( LEQ
		      (MEANING (PLUS-TREE (CDR Y)) A)
		      (MEANING X A))
		    (MEMBER X (CDR Y))
		    (LISTP (CDR Y))
		    (LISTP (CDDR Y))
		    (NOT (LISTP (DELETE X (CDR Y))))
		    (NOT (NUMBERP (MEANING (CAR Y) A))))
	       (EQUAL 0
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (PLUS-TREE (CDR Y)) A))
				(MEANING X A)))),

        which again simplifies, using linear arithmetic, applying
        NUMBERP-MEANING-PLUS-TREE, PLUS-RIGHT-ID2,
        COMMUTATIVITY-OF-PLUS, and DIFFERENCE-0, and expanding LESSP,
        NUMBERP, and EQUAL, to:

              T.

      Case 1.6.2.1.
              (IMPLIES (AND (NUMBERP (MEANING X A))
			    (NUMBERP (MEANING (PLUS-TREE (CDR Y)) A))
			    (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
				   (MEANING X A))
			    (LISTP Y)
			    (NOT (EQUAL X (CAR Y)))
			    ( LEQ (MEANING X A) (MEANING X A))
			    (MEMBER X (CDR Y))
			    (LISTP (CDR Y))
			    (LISTP (CDDR Y))
			    (NOT (LISTP (DELETE X (CDR Y))))
			    (NOT (NUMBERP (MEANING (CAR Y) A))))
		       (EQUAL 0
			      (DIFFERENCE (PLUS (MEANING (CAR Y) A)
						(MEANING X A))
					  (MEANING X A)))).

        However this simplifies again, rewriting with PLUS-RIGHT-ID2,
        COMMUTATIVITY-OF-PLUS, and DIFFERENCE-0, and expanding EQUAL,
        to:

              T.

    Case 1.6.1.
            (IMPLIES
	     (AND (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  ( LEQ
		    (MEANING (PLUS-TREE (CDR Y)) A)
		    (MEANING X A))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (LISTP (CDDR Y))
		  (NOT (LISTP (DELETE X (CDR Y))))
		  (NUMBERP (MEANING (CAR Y) A)))
	     (EQUAL (MEANING (CAR Y) A)
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (PLUS-TREE (CDR Y)) A))
				(MEANING X A)))).

      This again simplifies, using linear arithmetic and applying
      MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

            (IMPLIES
	     (AND (LESSP (PLUS (MEANING (CAR Y) A)
			       (MEANING (PLUS-TREE (CDR Y)) A))
			 (MEANING X A))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  ( LEQ
		    (MEANING (PLUS-TREE (CDR Y)) A)
		    (MEANING X A))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (LISTP (CDDR Y))
		  (NOT (LISTP (DELETE X (CDR Y))))
		  (NUMBERP (MEANING (CAR Y) A)))
	     (EQUAL (MEANING (CAR Y) A)
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (PLUS-TREE (CDR Y)) A))
				(MEANING X A)))),

      which again simplifies, using linear arithmetic and rewriting
      with the lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

            T.

  Case 1.5.
          (IMPLIES
	       (AND (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    (EQUAL (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				    A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X (CDR Y))
		    (LISTP (CDR Y))
		    (LISTP (CDDR Y))
		    (LISTP (DELETE X (CDR Y)))
		    (LISTP (CDR (DELETE X (CDR Y)))))
	       (EQUAL (MEANING (LIST 'PLUS
				     (CAR Y)
				     (PLUS-TREE (DELETE X (CDR Y))))
			       A)
		      (DIFFERENCE (MEANING (LIST 'PLUS
						 (CAR Y)
						 (PLUS-TREE (CDR Y)))
					   A)
				  (MEANING X A)))).

    However this simplifies again, rewriting with CAR-CONS and
    CDR-CONS, and unfolding the definition of MEANING, to:

          (IMPLIES
	     (AND (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (EQUAL (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				  A)
			 (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				     (MEANING X A)))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (LISTP (CDDR Y))
		  (LISTP (DELETE X (CDR Y)))
		  (LISTP (CDR (DELETE X (CDR Y)))))
	     (EQUAL (PLUS (MEANING (CAR Y) A)
			  (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				   A))
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (PLUS-TREE (CDR Y)) A))
				(MEANING X A)))),

    which we again simplify, using linear arithmetic, to two new
    conjectures:

    Case 1.5.2.
            (IMPLIES
	     (AND (LESSP (MEANING (PLUS-TREE (CDR Y)) A)
			 (MEANING X A))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (EQUAL (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				  A)
			 (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				     (MEANING X A)))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (LISTP (CDDR Y))
		  (LISTP (DELETE X (CDR Y)))
		  (LISTP (CDR (DELETE X (CDR Y)))))
	     (EQUAL (PLUS (MEANING (CAR Y) A)
			  (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				   A))
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (PLUS-TREE (CDR Y)) A))
				(MEANING X A)))).

      But this simplifies again, using linear arithmetic and applying
      MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

            T.

    Case 1.5.1.
            (IMPLIES
	     (AND (LESSP (PLUS (MEANING (CAR Y) A)
			       (MEANING (PLUS-TREE (CDR Y)) A))
			 (MEANING X A))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (EQUAL (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				  A)
			 (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				     (MEANING X A)))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (LISTP (CDDR Y))
		  (LISTP (DELETE X (CDR Y)))
		  (LISTP (CDR (DELETE X (CDR Y)))))
	     (EQUAL (PLUS (MEANING (CAR Y) A)
			  (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				   A))
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (PLUS-TREE (CDR Y)) A))
				(MEANING X A)))).

      But this simplifies again, using linear arithmetic, to the new
      conjecture:

            (IMPLIES
	     (AND (LESSP (MEANING (PLUS-TREE (CDR Y)) A)
			 (MEANING X A))
		  (LESSP (PLUS (MEANING (CAR Y) A)
			       (MEANING (PLUS-TREE (CDR Y)) A))
			 (MEANING X A))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (EQUAL (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				  A)
			 (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				     (MEANING X A)))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (LISTP (CDDR Y))
		  (LISTP (DELETE X (CDR Y)))
		  (LISTP (CDR (DELETE X (CDR Y)))))
	     (EQUAL (PLUS (MEANING (CAR Y) A)
			  (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				   A))
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (PLUS-TREE (CDR Y)) A))
				(MEANING X A)))).

      However this simplifies again, using linear arithmetic and
      applying MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

            T.

  Case 1.4.
          (IMPLIES
	       (AND (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    (EQUAL (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				    A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X (CDR Y))
		    (LISTP (CDR Y))
		    (LISTP (CDDR Y))
		    (LISTP (DELETE X (CDR Y)))
		    (NOT (LISTP (CDR (DELETE X (CDR Y))))))
	       (EQUAL (MEANING (LIST 'PLUS
				     (CAR Y)
				     (CAR (DELETE X (CDR Y))))
			       A)
		      (DIFFERENCE (MEANING (LIST 'PLUS
						 (CAR Y)
						 (PLUS-TREE (CDR Y)))
					   A)
				  (MEANING X A)))),

    which again simplifies, applying the lemmas CAR-CONS, CDR-CONS,
    and PLUS-RIGHT-ID2, and opening up PLUS-TREE, MEANING, and FIX,
    to the following three new formulas:

    Case 1.4.3.
            (IMPLIES
	     (AND (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  (EQUAL 0
			 (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				     (MEANING X A)))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (LISTP (CDDR Y))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NOT (NUMBERP (MEANING (CAR Y) A))))
	     (EQUAL 0
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (PLUS-TREE (CDR Y)) A))
				(MEANING X A)))),

      which we again simplify, applying EQUAL-DIFFERENCE-0,
      NUMBERP-MEANING-PLUS-TREE, and DIFFERENCE-0, and unfolding PLUS
      and EQUAL, to:

            T.

    Case 1.4.2.
            (IMPLIES
	     (AND (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  (EQUAL 0
			 (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				     (MEANING X A)))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (LISTP (CDDR Y))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NUMBERP (MEANING (CAR Y) A)))
	     (EQUAL (MEANING (CAR Y) A)
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (PLUS-TREE (CDR Y)) A))
				(MEANING X A)))),

      which again simplifies, using linear arithmetic, to two new
      goals:

      Case 1.4.2.2.
              (IMPLIES
	       (AND
		  (LESSP (MEANING (PLUS-TREE (CDR Y)) A)
			 (MEANING X A))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  (EQUAL 0
			 (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				     (MEANING X A)))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (LISTP (CDDR Y))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NUMBERP (MEANING (CAR Y) A)))
	       (EQUAL
		    (MEANING (CAR Y) A)
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (PLUS-TREE (CDR Y)) A))
				(MEANING X A)))).

        This simplifies again, using linear arithmetic and rewriting
        with MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

              T.

      Case 1.4.2.1.
              (IMPLIES
	       (AND
		  (LESSP (PLUS (MEANING (CAR Y) A)
			       (MEANING (PLUS-TREE (CDR Y)) A))
			 (MEANING X A))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  (EQUAL 0
			 (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				     (MEANING X A)))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (LISTP (CDDR Y))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NUMBERP (MEANING (CAR Y) A)))
	       (EQUAL
		    (MEANING (CAR Y) A)
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (PLUS-TREE (CDR Y)) A))
				(MEANING X A)))),

        which we again simplify, using linear arithmetic, to:

              (IMPLIES
	       (AND
		  (LESSP (MEANING (PLUS-TREE (CDR Y)) A)
			 (MEANING X A))
		  (LESSP (PLUS (MEANING (CAR Y) A)
			       (MEANING (PLUS-TREE (CDR Y)) A))
			 (MEANING X A))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  (EQUAL 0
			 (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				     (MEANING X A)))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (LISTP (CDDR Y))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NUMBERP (MEANING (CAR Y) A)))
	       (EQUAL
		    (MEANING (CAR Y) A)
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (PLUS-TREE (CDR Y)) A))
				(MEANING X A)))).

        This again simplifies, using linear arithmetic and rewriting
        with the lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

              T.

    Case 1.4.1.
            (IMPLIES
	     (AND (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A))
		  (EQUAL (MEANING (CAR (DELETE X (CDR Y))) A)
			 (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				     (MEANING X A)))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (LISTP (CDDR Y))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y))))))
	     (EQUAL (PLUS (MEANING (CAR Y) A)
			  (MEANING (CAR (DELETE X (CDR Y))) A))
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (PLUS-TREE (CDR Y)) A))
				(MEANING X A)))),

      which we again simplify, using linear arithmetic, to two new
      goals:

      Case 1.4.1.2.
              (IMPLIES
	       (AND (LESSP (MEANING (PLUS-TREE (CDR Y)) A)
			   (MEANING X A))
		    (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A))
		    (EQUAL (MEANING (CAR (DELETE X (CDR Y))) A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X (CDR Y))
		    (LISTP (CDR Y))
		    (LISTP (CDDR Y))
		    (LISTP (DELETE X (CDR Y)))
		    (NOT (LISTP (CDR (DELETE X (CDR Y))))))
	       (EQUAL
		    (PLUS (MEANING (CAR Y) A)
			  (MEANING (CAR (DELETE X (CDR Y))) A))
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (PLUS-TREE (CDR Y)) A))
				(MEANING X A)))).

        But this again simplifies, using linear arithmetic and
        applying the lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

              T.

      Case 1.4.1.1.
              (IMPLIES
	       (AND (LESSP (PLUS (MEANING (CAR Y) A)
				 (MEANING (PLUS-TREE (CDR Y)) A))
			   (MEANING X A))
		    (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A))
		    (EQUAL (MEANING (CAR (DELETE X (CDR Y))) A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X (CDR Y))
		    (LISTP (CDR Y))
		    (LISTP (CDDR Y))
		    (LISTP (DELETE X (CDR Y)))
		    (NOT (LISTP (CDR (DELETE X (CDR Y))))))
	       (EQUAL
		    (PLUS (MEANING (CAR Y) A)
			  (MEANING (CAR (DELETE X (CDR Y))) A))
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (PLUS-TREE (CDR Y)) A))
				(MEANING X A)))).

        This simplifies again, using linear arithmetic, to the goal:

              (IMPLIES
	       (AND (LESSP (MEANING (PLUS-TREE (CDR Y)) A)
			   (MEANING X A))
		    (LESSP (PLUS (MEANING (CAR Y) A)
				 (MEANING (PLUS-TREE (CDR Y)) A))
			   (MEANING X A))
		    (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A))
		    (EQUAL (MEANING (CAR (DELETE X (CDR Y))) A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X (CDR Y))
		    (LISTP (CDR Y))
		    (LISTP (CDDR Y))
		    (LISTP (DELETE X (CDR Y)))
		    (NOT (LISTP (CDR (DELETE X (CDR Y))))))
	       (EQUAL
		    (PLUS (MEANING (CAR Y) A)
			  (MEANING (CAR (DELETE X (CDR Y))) A))
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (PLUS-TREE (CDR Y)) A))
				(MEANING X A)))),

        which again simplifies, using linear arithmetic and applying
        MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

              T.

  Case 1.3.
          (IMPLIES
	    (AND (LISTP Y)
		 (NOT (EQUAL X (CAR Y)))
		 (EQUAL (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				 A)
			(DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				    (MEANING X A)))
		 (MEMBER X (CDR Y))
		 (LISTP (CDR Y))
		 (NOT (LISTP (CDDR Y)))
		 (NOT (LISTP (DELETE X (CDR Y)))))
	    (EQUAL (MEANING (LIST 'FIX (CAR Y)) A)
		   (DIFFERENCE (MEANING (LIST 'PLUS (CAR Y) (CADR Y))
					A)
			       (MEANING X A)))),

    which we again simplify, rewriting with EQUAL-DIFFERENCE-0,
    CAR-CONS, and CDR-CONS, and expanding the functions PLUS-TREE,
    MEANING, CAR, and FIX, to two new goals:

    Case 1.3.2.
            (IMPLIES (AND (LISTP Y)
			  (NOT (EQUAL X (CAR Y)))
			  ( LEQ
			    (MEANING (PLUS-TREE (CDR Y)) A)
			    (MEANING X A))
			  (MEMBER X (CDR Y))
			  (LISTP (CDR Y))
			  (NOT (LISTP (CDDR Y)))
			  (NOT (LISTP (DELETE X (CDR Y))))
			  (NOT (NUMBERP (MEANING (CAR Y) A))))
		     (EQUAL 0
			    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
					      (MEANING (CADR Y) A))
					(MEANING X A)))).

      But this again simplifies, using linear arithmetic and applying
      the lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to the following
      three new formulas:

      Case 1.3.2.3.
              (IMPLIES
		  (AND (NOT (NUMBERP (MEANING (PLUS-TREE (CDR Y)) A)))
		       (LISTP Y)
		       (NOT (EQUAL X (CAR Y)))
		       ( LEQ
			 (MEANING (PLUS-TREE (CDR Y)) A)
			 (MEANING X A))
		       (MEMBER X (CDR Y))
		       (LISTP (CDR Y))
		       (NOT (LISTP (CDDR Y)))
		       (NOT (LISTP (DELETE X (CDR Y))))
		       (NOT (NUMBERP (MEANING (CAR Y) A))))
		  (EQUAL 0
			 (DIFFERENCE (PLUS (MEANING (CAR Y) A)
					   (MEANING (CADR Y) A))
				     (MEANING X A)))),

        which we again simplify, applying NUMBERP-MEANING-PLUS-TREE,
        to:

              T.

      Case 1.3.2.2.
              (IMPLIES (AND (NOT (NUMBERP (MEANING X A)))
			    (LISTP Y)
			    (NOT (EQUAL X (CAR Y)))
			    ( LEQ
			      (MEANING (PLUS-TREE (CDR Y)) A)
			      (MEANING X A))
			    (MEMBER X (CDR Y))
			    (LISTP (CDR Y))
			    (NOT (LISTP (CDDR Y)))
			    (NOT (LISTP (DELETE X (CDR Y))))
			    (NOT (NUMBERP (MEANING (CAR Y) A))))
		       (EQUAL 0
			      (DIFFERENCE (PLUS (MEANING (CAR Y) A)
						(MEANING (CADR Y) A))
					  (MEANING X A)))).

        But this again simplifies, rewriting with the lemma
        NUMBERP-MEANING-PLUS-TREE, and unfolding LESSP, PLUS, and
        DIFFERENCE, to the conjecture:

              (IMPLIES (AND (NOT (NUMBERP (MEANING X A)))
			    (LISTP Y)
			    (NOT (EQUAL X (CAR Y)))
			    (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
				   0)
			    (MEMBER X (CDR Y))
			    (LISTP (CDR Y))
			    (NOT (LISTP (CDDR Y)))
			    (NOT (LISTP (DELETE X (CDR Y))))
			    (NOT (NUMBERP (MEANING (CAR Y) A)))
			    (NUMBERP (MEANING (CADR Y) A))
			    (NOT (EQUAL (MEANING (CADR Y) A) 0)))
		       (EQUAL 0 (MEANING (CADR Y) A))),

        which we again simplify, obviously, to the formula:

              (IMPLIES (AND (NOT (NUMBERP (MEANING X A)))
			    (LISTP Y)
			    (NOT (EQUAL X (CAR Y)))
			    (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
				   0)
			    (MEMBER X (CDR Y))
			    (LISTP (CDR Y))
			    (NOT (LISTP (CDDR Y)))
			    (NOT (LISTP (DELETE X (CDR Y))))
			    (NOT (NUMBERP (MEANING (CAR Y) A)))
			    (NUMBERP (MEANING (CADR Y) A)))
		       (EQUAL 0 (MEANING (CADR Y) A))),

        which we finally simplify, rewriting with the lemma CAR-CONS,
        and expanding the definitions of PLUS-TREE, MEANING, and FIX,
        to:

              T.

      Case 1.3.2.1.
              (IMPLIES (AND (NUMBERP (MEANING X A))
			    (NUMBERP (MEANING (PLUS-TREE (CDR Y)) A))
			    (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
				   (MEANING X A))
			    (LISTP Y)
			    (NOT (EQUAL X (CAR Y)))
			    ( LEQ (MEANING X A) (MEANING X A))
			    (MEMBER X (CDR Y))
			    (LISTP (CDR Y))
			    (NOT (LISTP (CDDR Y)))
			    (NOT (LISTP (DELETE X (CDR Y))))
			    (NOT (NUMBERP (MEANING (CAR Y) A))))
		       (EQUAL 0
			      (DIFFERENCE (PLUS (MEANING (CAR Y) A)
						(MEANING (CADR Y) A))
					  (MEANING X A)))).

        But this again simplifies, applying EQUAL-DIFFERENCE-0, and
        expanding the function PLUS, to the following two new
        conjectures:

        Case 1.3.2.1.2.
                (IMPLIES (AND (NUMBERP (MEANING X A))
			      (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
				     (MEANING X A))
			      (LISTP Y)
			      (NOT (EQUAL X (CAR Y)))
			      ( LEQ (MEANING X A) (MEANING X A))
			      (MEMBER X (CDR Y))
			      (LISTP (CDR Y))
			      (NOT (LISTP (CDDR Y)))
			      (NOT (LISTP (DELETE X (CDR Y))))
			      (NOT (NUMBERP (MEANING (CAR Y) A)))
			      (NOT (NUMBERP (MEANING (CADR Y) A))))
			 ( LEQ 0 (MEANING X A))),

          which we again simplify, using linear arithmetic, to:

                T.

        Case 1.3.2.1.1.
                (IMPLIES (AND (NUMBERP (MEANING X A))
			      (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
				     (MEANING X A))
			      (LISTP Y)
			      (NOT (EQUAL X (CAR Y)))
			      ( LEQ (MEANING X A) (MEANING X A))
			      (MEMBER X (CDR Y))
			      (LISTP (CDR Y))
			      (NOT (LISTP (CDDR Y)))
			      (NOT (LISTP (DELETE X (CDR Y))))
			      (NOT (NUMBERP (MEANING (CAR Y) A)))
			      (NUMBERP (MEANING (CADR Y) A)))
			 ( LEQ
			   (MEANING (CADR Y) A)
			   (MEANING X A))).

          This simplifies further, appealing to the lemmas CAR-CONS,
          CONS-CAR-CDR, and DELETE-NON-MEMBER, and unfolding
          PLUS-TREE, MEANING, FIX, MEMBER, and DELETE, to:

                T.

    Case 1.3.1.
            (IMPLIES (AND (LISTP Y)
			  (NOT (EQUAL X (CAR Y)))
			  ( LEQ
			    (MEANING (PLUS-TREE (CDR Y)) A)
			    (MEANING X A))
			  (MEMBER X (CDR Y))
			  (LISTP (CDR Y))
			  (NOT (LISTP (CDDR Y)))
			  (NOT (LISTP (DELETE X (CDR Y))))
			  (NUMBERP (MEANING (CAR Y) A)))
		     (EQUAL (MEANING (CAR Y) A)
			    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
					      (MEANING (CADR Y) A))
					(MEANING X A)))),

      which again simplifies, using linear arithmetic and rewriting
      with MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to three new goals:

      Case 1.3.1.3.
              (IMPLIES
		  (AND (NOT (NUMBERP (MEANING (PLUS-TREE (CDR Y)) A)))
		       (LISTP Y)
		       (NOT (EQUAL X (CAR Y)))
		       ( LEQ
			 (MEANING (PLUS-TREE (CDR Y)) A)
			 (MEANING X A))
		       (MEMBER X (CDR Y))
		       (LISTP (CDR Y))
		       (NOT (LISTP (CDDR Y)))
		       (NOT (LISTP (DELETE X (CDR Y))))
		       (NUMBERP (MEANING (CAR Y) A)))
		  (EQUAL (MEANING (CAR Y) A)
			 (DIFFERENCE (PLUS (MEANING (CAR Y) A)
					   (MEANING (CADR Y) A))
				     (MEANING X A)))).

        This simplifies again, rewriting with
        NUMBERP-MEANING-PLUS-TREE, to:

              T.

      Case 1.3.1.2.
              (IMPLIES (AND (NOT (NUMBERP (MEANING X A)))
			    (LISTP Y)
			    (NOT (EQUAL X (CAR Y)))
			    ( LEQ
			      (MEANING (PLUS-TREE (CDR Y)) A)
			      (MEANING X A))
			    (MEMBER X (CDR Y))
			    (LISTP (CDR Y))
			    (NOT (LISTP (CDDR Y)))
			    (NOT (LISTP (DELETE X (CDR Y))))
			    (NUMBERP (MEANING (CAR Y) A)))
		       (EQUAL (MEANING (CAR Y) A)
			      (DIFFERENCE (PLUS (MEANING (CAR Y) A)
						(MEANING (CADR Y) A))
					  (MEANING X A)))),

        which again simplifies, applying NUMBERP-MEANING-PLUS-TREE
        and PLUS-EQUAL-0, and unfolding the definitions of LESSP and
        DIFFERENCE, to two new goals:

        Case 1.3.1.2.2.
                (IMPLIES (AND (NOT (NUMBERP (MEANING X A)))
			      (LISTP Y)
			      (NOT (EQUAL X (CAR Y)))
			      (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
				     0)
			      (MEMBER X (CDR Y))
			      (LISTP (CDR Y))
			      (NOT (LISTP (CDDR Y)))
			      (NOT (LISTP (DELETE X (CDR Y))))
			      (NUMBERP (MEANING (CAR Y) A))
			      (NOT (EQUAL (MEANING (CADR Y) A) 0))
			      (NUMBERP (MEANING (CADR Y) A)))
			 (EQUAL (MEANING (CAR Y) A)
				(PLUS (MEANING (CAR Y) A)
				      (MEANING (CADR Y) A)))),

          which further simplifies, applying the lemma CAR-CONS, and
          opening up the definitions of PLUS-TREE, MEANING, and FIX,
          to:

                T.

        Case 1.3.1.2.1.
                (IMPLIES (AND (NOT (NUMBERP (MEANING X A)))
			      (LISTP Y)
			      (NOT (EQUAL X (CAR Y)))
			      (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
				     0)
			      (MEMBER X (CDR Y))
			      (LISTP (CDR Y))
			      (NOT (LISTP (CDDR Y)))
			      (NOT (LISTP (DELETE X (CDR Y))))
			      (NUMBERP (MEANING (CAR Y) A))
			      (NOT (EQUAL (MEANING (CAR Y) A) 0)))
			 (EQUAL (MEANING (CAR Y) A)
				(PLUS (MEANING (CAR Y) A)
				      (MEANING (CADR Y) A)))).

          However this simplifies further, applying CAR-CONS,
          CONS-CAR-CDR, DELETE-NON-MEMBER, and COMMUTATIVITY-OF-PLUS,
          and opening up the definitions of PLUS-TREE, MEANING, FIX,
          MEMBER, DELETE, and PLUS, to:

                T.

      Case 1.3.1.1.
              (IMPLIES (AND (NUMBERP (MEANING X A))
			    (NUMBERP (MEANING (PLUS-TREE (CDR Y)) A))
			    (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
				   (MEANING X A))
			    (LISTP Y)
			    (NOT (EQUAL X (CAR Y)))
			    ( LEQ (MEANING X A) (MEANING X A))
			    (MEMBER X (CDR Y))
			    (LISTP (CDR Y))
			    (NOT (LISTP (CDDR Y)))
			    (NOT (LISTP (DELETE X (CDR Y))))
			    (NUMBERP (MEANING (CAR Y) A)))
		       (EQUAL (MEANING (CAR Y) A)
			      (DIFFERENCE (PLUS (MEANING (CAR Y) A)
						(MEANING (CADR Y) A))
					  (MEANING X A)))),

        which again simplifies, obviously, to the conjecture:

              (IMPLIES (AND (NUMBERP (MEANING X A))
			    (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
				   (MEANING X A))
			    (LISTP Y)
			    (NOT (EQUAL X (CAR Y)))
			    ( LEQ (MEANING X A) (MEANING X A))
			    (MEMBER X (CDR Y))
			    (LISTP (CDR Y))
			    (NOT (LISTP (CDDR Y)))
			    (NOT (LISTP (DELETE X (CDR Y))))
			    (NUMBERP (MEANING (CAR Y) A)))
		       (EQUAL (MEANING (CAR Y) A)
			      (DIFFERENCE (PLUS (MEANING (CAR Y) A)
						(MEANING (CADR Y) A))
					  (MEANING X A)))).

        But this simplifies further, rewriting with the lemmas
        CAR-CONS, CONS-CAR-CDR, DELETE-NON-MEMBER,
        COMMUTATIVITY-OF-PLUS, and DIFFERENCE-PLUS, and unfolding
        PLUS-TREE, MEANING, FIX, LESSP, MEMBER, DELETE, EQUAL, PLUS,
        and DIFFERENCE, to:

              T.

  Case 1.2.
          (IMPLIES
	    (AND (LISTP Y)
		 (NOT (EQUAL X (CAR Y)))
		 (EQUAL (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				 A)
			(DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				    (MEANING X A)))
		 (MEMBER X (CDR Y))
		 (LISTP (CDR Y))
		 (NOT (LISTP (CDDR Y)))
		 (LISTP (DELETE X (CDR Y)))
		 (LISTP (CDR (DELETE X (CDR Y)))))
	    (EQUAL (MEANING (LIST 'PLUS
				  (CAR Y)
				  (PLUS-TREE (DELETE X (CDR Y))))
			    A)
		   (DIFFERENCE (MEANING (LIST 'PLUS (CAR Y) (CADR Y))
					A)
			       (MEANING X A)))),

    which we again simplify, rewriting with CAR-CONS and CDR-CONS,
    and expanding the function MEANING, to:

          (IMPLIES
	       (AND (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    (EQUAL (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				    A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X (CDR Y))
		    (LISTP (CDR Y))
		    (NOT (LISTP (CDDR Y)))
		    (LISTP (DELETE X (CDR Y)))
		    (LISTP (CDR (DELETE X (CDR Y)))))
	       (EQUAL (PLUS (MEANING (CAR Y) A)
			    (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				     A))
		      (DIFFERENCE (PLUS (MEANING (CAR Y) A)
					(MEANING (CADR Y) A))
				  (MEANING X A)))).

    This further simplifies, rewriting with CONS-CAR-CDR,
    DELETE-NON-MEMBER, and CAR-CONS, and unfolding MEMBER, DELETE,
    PLUS-TREE, MEANING, and FIX, to:

          T.

  Case 1.1.
          (IMPLIES
	    (AND (LISTP Y)
		 (NOT (EQUAL X (CAR Y)))
		 (EQUAL (MEANING (PLUS-TREE (DELETE X (CDR Y)))
				 A)
			(DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				    (MEANING X A)))
		 (MEMBER X (CDR Y))
		 (LISTP (CDR Y))
		 (NOT (LISTP (CDDR Y)))
		 (LISTP (DELETE X (CDR Y)))
		 (NOT (LISTP (CDR (DELETE X (CDR Y))))))
	    (EQUAL (MEANING (LIST 'PLUS
				  (CAR Y)
				  (CAR (DELETE X (CDR Y))))
			    A)
		   (DIFFERENCE (MEANING (LIST 'PLUS (CAR Y) (CADR Y))
					A)
			       (MEANING X A)))).

    This simplifies again, applying CAR-CONS, CDR-CONS, and
    PLUS-RIGHT-ID2, and unfolding the functions PLUS-TREE, MEANING,
    and FIX, to three new conjectures:

    Case 1.1.3.
            (IMPLIES
	     (AND (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  (EQUAL 0
			 (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				     (MEANING X A)))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (NOT (LISTP (CDDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NOT (NUMBERP (MEANING (CAR Y) A))))
	     (EQUAL 0
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (CADR Y) A))
				(MEANING X A)))).

      However this again simplifies, rewriting with
      EQUAL-DIFFERENCE-0, and unfolding the definition of PLUS, to
      two new formulas:

      Case 1.1.3.2.
              (IMPLIES
	       (AND
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  ( LEQ
		    (MEANING (PLUS-TREE (CDR Y)) A)
		    (MEANING X A))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (NOT (LISTP (CDDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NOT (NUMBERP (MEANING (CAR Y) A)))
		  (NOT (NUMBERP (MEANING (CADR Y) A))))
	       ( LEQ 0 (MEANING X A))).

        This simplifies again, using linear arithmetic, to:

              T.

      Case 1.1.3.1.
              (IMPLIES
	       (AND
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  ( LEQ
		    (MEANING (PLUS-TREE (CDR Y)) A)
		    (MEANING X A))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (NOT (LISTP (CDDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NOT (NUMBERP (MEANING (CAR Y) A)))
		  (NUMBERP (MEANING (CADR Y) A)))
	       ( LEQ
		 (MEANING (CADR Y) A)
		 (MEANING X A))).

        But this again simplifies, using linear arithmetic and
        rewriting with the lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP,
        to three new conjectures:

        Case 1.1.3.1.3.
                (IMPLIES
		 (AND
		  (NOT (NUMBERP (MEANING (PLUS-TREE (CDR Y)) A)))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  ( LEQ
		    (MEANING (PLUS-TREE (CDR Y)) A)
		    (MEANING X A))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (NOT (LISTP (CDDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NOT (NUMBERP (MEANING (CAR Y) A)))
		  (NUMBERP (MEANING (CADR Y) A)))
		 ( LEQ
		   (MEANING (CADR Y) A)
		   (MEANING X A))),

          which again simplifies, applying NUMBERP-MEANING-PLUS-TREE,
          to:

                T.

        Case 1.1.3.1.2.
                (IMPLIES
		 (AND
		  (NOT (NUMBERP (MEANING X A)))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  ( LEQ
		    (MEANING (PLUS-TREE (CDR Y)) A)
		    (MEANING X A))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (NOT (LISTP (CDDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NOT (NUMBERP (MEANING (CAR Y) A)))
		  (NUMBERP (MEANING (CADR Y) A)))
		 ( LEQ
		   (MEANING (CADR Y) A)
		   (MEANING X A))),

          which we again simplify, applying the lemma
          NUMBERP-MEANING-PLUS-TREE, and unfolding the function LESSP,
          to:

                (IMPLIES
		 (AND
		  (NOT (NUMBERP (MEANING X A)))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
			 0)
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (NOT (LISTP (CDDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NOT (NUMBERP (MEANING (CAR Y) A)))
		  (NUMBERP (MEANING (CADR Y) A)))
		 (EQUAL (MEANING (CADR Y) A) 0)),

          which we finally simplify, rewriting with CONS-CAR-CDR,
          DELETE-NON-MEMBER, and CAR-CONS, and unfolding MEMBER,
          DELETE, PLUS-TREE, MEANING, FIX, and EQUAL, to:

                T.

        Case 1.1.3.1.1.
                (IMPLIES
		 (AND
		  (NUMBERP (MEANING X A))
		  (NUMBERP (MEANING (PLUS-TREE (CDR Y)) A))
		  (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
			 (MEANING X A))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  ( LEQ (MEANING X A) (MEANING X A))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (NOT (LISTP (CDDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NOT (NUMBERP (MEANING (CAR Y) A)))
		  (NUMBERP (MEANING (CADR Y) A)))
		 ( LEQ
		   (MEANING (CADR Y) A)
		   (MEANING X A))).

          This again simplifies, obviously, to:

                (IMPLIES
		 (AND
		  (NUMBERP (MEANING X A))
		  (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
			 (MEANING X A))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  ( LEQ (MEANING X A) (MEANING X A))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (NOT (LISTP (CDDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NOT (NUMBERP (MEANING (CAR Y) A)))
		  (NUMBERP (MEANING (CADR Y) A)))
		 ( LEQ
		   (MEANING (CADR Y) A)
		   (MEANING X A))).

          But this finally simplifies, applying CAR-CONS,
          CONS-CAR-CDR, and DELETE-NON-MEMBER, and unfolding the
          functions PLUS-TREE, MEANING, FIX, MEMBER, and DELETE, to:

                T.

    Case 1.1.2.
            (IMPLIES
	     (AND (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  (EQUAL 0
			 (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				     (MEANING X A)))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (NOT (LISTP (CDDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NUMBERP (MEANING (CAR Y) A)))
	     (EQUAL (MEANING (CAR Y) A)
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (CADR Y) A))
				(MEANING X A)))),

      which we again simplify, applying EQUAL-DIFFERENCE-0, to:

            (IMPLIES
	     (AND (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  ( LEQ
		    (MEANING (PLUS-TREE (CDR Y)) A)
		    (MEANING X A))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (NOT (LISTP (CDDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NUMBERP (MEANING (CAR Y) A)))
	     (EQUAL (MEANING (CAR Y) A)
		    (DIFFERENCE (PLUS (MEANING (CAR Y) A)
				      (MEANING (CADR Y) A))
				(MEANING X A)))).

      But this simplifies again, using linear arithmetic and applying
      the lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to three new
      goals:

      Case 1.1.2.3.
              (IMPLIES
	       (AND
		  (NOT (NUMBERP (MEANING (PLUS-TREE (CDR Y)) A)))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  ( LEQ
		    (MEANING (PLUS-TREE (CDR Y)) A)
		    (MEANING X A))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (NOT (LISTP (CDDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NUMBERP (MEANING (CAR Y) A)))
	       (EQUAL (MEANING (CAR Y) A)
		      (DIFFERENCE (PLUS (MEANING (CAR Y) A)
					(MEANING (CADR Y) A))
				  (MEANING X A)))).

        But this again simplifies, applying NUMBERP-MEANING-PLUS-TREE,
        to:

              T.

      Case 1.1.2.2.
              (IMPLIES
	       (AND
		  (NOT (NUMBERP (MEANING X A)))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  ( LEQ
		    (MEANING (PLUS-TREE (CDR Y)) A)
		    (MEANING X A))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (NOT (LISTP (CDDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NUMBERP (MEANING (CAR Y) A)))
	       (EQUAL (MEANING (CAR Y) A)
		      (DIFFERENCE (PLUS (MEANING (CAR Y) A)
					(MEANING (CADR Y) A))
				  (MEANING X A)))).

        But this simplifies again, rewriting with
        NUMBERP-MEANING-PLUS-TREE and PLUS-EQUAL-0, and unfolding the
        definitions of LESSP and DIFFERENCE, to two new conjectures:

        Case 1.1.2.2.2.
                (IMPLIES
		 (AND
		  (NOT (NUMBERP (MEANING X A)))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
			 0)
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (NOT (LISTP (CDDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NUMBERP (MEANING (CAR Y) A))
		  (NOT (EQUAL (MEANING (CADR Y) A) 0))
		  (NUMBERP (MEANING (CADR Y) A)))
		 (EQUAL (MEANING (CAR Y) A)
			(PLUS (MEANING (CAR Y) A)
			      (MEANING (CADR Y) A)))).

          But this finally simplifies, rewriting with CONS-CAR-CDR,
          DELETE-NON-MEMBER, and CAR-CONS, and unfolding MEMBER,
          DELETE, PLUS-TREE, MEANING, FIX, and EQUAL, to:

                T.

        Case 1.1.2.2.1.
                (IMPLIES
		 (AND
		  (NOT (NUMBERP (MEANING X A)))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
			 0)
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (NOT (LISTP (CDDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NUMBERP (MEANING (CAR Y) A))
		  (NOT (EQUAL (MEANING (CAR Y) A) 0)))
		 (EQUAL (MEANING (CAR Y) A)
			(PLUS (MEANING (CAR Y) A)
			      (MEANING (CADR Y) A)))),

          which we finally simplify, appealing to the lemmas
          CONS-CAR-CDR, DELETE-NON-MEMBER, CAR-CONS, and
          PLUS-RIGHT-ID2, and expanding MEMBER, DELETE, PLUS-TREE,
          MEANING, FIX, and EQUAL, to:

                T.

      Case 1.1.2.1.
              (IMPLIES
	       (AND
		  (NUMBERP (MEANING X A))
		  (NUMBERP (MEANING (PLUS-TREE (CDR Y)) A))
		  (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
			 (MEANING X A))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  ( LEQ (MEANING X A) (MEANING X A))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (NOT (LISTP (CDDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NUMBERP (MEANING (CAR Y) A)))
	       (EQUAL (MEANING (CAR Y) A)
		      (DIFFERENCE (PLUS (MEANING (CAR Y) A)
					(MEANING (CADR Y) A))
				  (MEANING X A)))),

        which we again simplify, obviously, to the goal:

              (IMPLIES
	       (AND
		  (NUMBERP (MEANING X A))
		  (EQUAL (MEANING (PLUS-TREE (CDR Y)) A)
			 (MEANING X A))
		  (LISTP Y)
		  (NOT (EQUAL X (CAR Y)))
		  (NOT (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A)))
		  ( LEQ (MEANING X A) (MEANING X A))
		  (MEMBER X (CDR Y))
		  (LISTP (CDR Y))
		  (NOT (LISTP (CDDR Y)))
		  (LISTP (DELETE X (CDR Y)))
		  (NOT (LISTP (CDR (DELETE X (CDR Y)))))
		  (NUMBERP (MEANING (CAR Y) A)))
	       (EQUAL (MEANING (CAR Y) A)
		      (DIFFERENCE (PLUS (MEANING (CAR Y) A)
					(MEANING (CADR Y) A))
				  (MEANING X A)))),

        which finally simplifies, applying CAR-CONS, CONS-CAR-CDR,
        DELETE-NON-MEMBER, and PLUS-RIGHT-ID2, and opening up
        PLUS-TREE, MEANING, FIX, MEMBER, DELETE, LESSP, EQUAL, and
        DIFFERENCE, to:

              T.

    Case 1.1.1.
            (IMPLIES
	       (AND (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    (NUMBERP (MEANING (CAR (DELETE X (CDR Y))) A))
		    (EQUAL (MEANING (CAR (DELETE X (CDR Y))) A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X (CDR Y))
		    (LISTP (CDR Y))
		    (NOT (LISTP (CDDR Y)))
		    (LISTP (DELETE X (CDR Y)))
		    (NOT (LISTP (CDR (DELETE X (CDR Y))))))
	       (EQUAL (PLUS (MEANING (CAR Y) A)
			    (MEANING (CAR (DELETE X (CDR Y))) A))
		      (DIFFERENCE (PLUS (MEANING (CAR Y) A)
					(MEANING (CADR Y) A))
				  (MEANING X A)))),

      which we again simplify, trivially, to the goal:

            (IMPLIES
	       (AND (LISTP Y)
		    (NOT (EQUAL X (CAR Y)))
		    (EQUAL (MEANING (CAR (DELETE X (CDR Y))) A)
			   (DIFFERENCE (MEANING (PLUS-TREE (CDR Y)) A)
				       (MEANING X A)))
		    (MEMBER X (CDR Y))
		    (LISTP (CDR Y))
		    (NOT (LISTP (CDDR Y)))
		    (LISTP (DELETE X (CDR Y)))
		    (NOT (LISTP (CDR (DELETE X (CDR Y))))))
	       (EQUAL (PLUS (MEANING (CAR Y) A)
			    (MEANING (CAR (DELETE X (CDR Y))) A))
		      (DIFFERENCE (PLUS (MEANING (CAR Y) A)
					(MEANING (CADR Y) A))
				  (MEANING X A)))).

      However this further simplifies, applying CONS-CAR-CDR,
      DELETE-NON-MEMBER, CAR-CONS, PLUS-EQUAL-0, and
      DIFFERENCE-CANCELLATION-0, and expanding MEMBER, DELETE,
      PLUS-TREE, MEANING, and FIX, to three new formulas:

      Case 1.1.1.3.
              (IMPLIES (AND (LISTP Y)
			    (NOT (EQUAL X (CAR Y)))
			    (NUMBERP (MEANING (CADR Y) A))
			    (NOT (EQUAL X (CADR Y)))
			    (EQUAL (MEANING (CADR Y) A)
				   (DIFFERENCE (MEANING (CADR Y) A)
					       (MEANING X A)))
			    (MEMBER X (CDR Y))
			    (LISTP (CDR Y))
			    (NOT (LISTP (CDDR Y)))
			    (NOT (EQUAL (MEANING (CAR Y) A) 0))
			    (NUMBERP (MEANING (CAR Y) A))
			    (NOT (EQUAL (MEANING X A) 0)))
		       (NOT (NUMBERP (MEANING X A)))),

        which again simplifies, using linear arithmetic, to:

              (IMPLIES (AND (LESSP (MEANING (CADR Y) A)
				   (MEANING X A))
			    (LISTP Y)
			    (NOT (EQUAL X (CAR Y)))
			    (NUMBERP (MEANING (CADR Y) A))
			    (NOT (EQUAL X (CADR Y)))
			    (EQUAL (MEANING (CADR Y) A)
				   (DIFFERENCE (MEANING (CADR Y) A)
					       (MEANING X A)))
			    (MEMBER X (CDR Y))
			    (LISTP (CDR Y))
			    (NOT (LISTP (CDDR Y)))
			    (NOT (EQUAL (MEANING (CAR Y) A) 0))
			    (NUMBERP (MEANING (CAR Y) A))
			    (NOT (EQUAL (MEANING X A) 0)))
		       (NOT (NUMBERP (MEANING X A)))).

        But this finally simplifies, using linear arithmetic,
        rewriting with MEMBER-IMPLIES-PLUS-TREE-GREATEREQP and
        CAR-CONS, and opening up FIX, MEANING, and PLUS-TREE, to:

              T.

      Case 1.1.1.2.
              (IMPLIES (AND (LISTP Y)
			    (NOT (EQUAL X (CAR Y)))
			    (NUMBERP (MEANING (CADR Y) A))
			    (NOT (EQUAL X (CADR Y)))
			    (EQUAL (MEANING (CADR Y) A)
				   (DIFFERENCE (MEANING (CADR Y) A)
					       (MEANING X A)))
			    (MEMBER X (CDR Y))
			    (LISTP (CDR Y))
			    (NOT (LISTP (CDDR Y)))
			    (NOT (NUMBERP (MEANING (CAR Y) A)))
			    (NOT (EQUAL (MEANING (CADR Y) A) 0))
			    (NOT (EQUAL (MEANING X A) 0)))
		       (NOT (NUMBERP (MEANING X A)))),

        which we again simplify, using linear arithmetic, to:

              (IMPLIES (AND (LESSP (MEANING (CADR Y) A)
				   (MEANING X A))
			    (LISTP Y)
			    (NOT (EQUAL X (CAR Y)))
			    (NUMBERP (MEANING (CADR Y) A))
			    (NOT (EQUAL X (CADR Y)))
			    (EQUAL (MEANING (CADR Y) A)
				   (DIFFERENCE (MEANING (CADR Y) A)
					       (MEANING X A)))
			    (MEMBER X (CDR Y))
			    (LISTP (CDR Y))
			    (NOT (LISTP (CDDR Y)))
			    (NOT (NUMBERP (MEANING (CAR Y) A)))
			    (NOT (EQUAL (MEANING (CADR Y) A) 0))
			    (NOT (EQUAL (MEANING X A) 0)))
		       (NOT (NUMBERP (MEANING X A)))),

        which we finally simplify, using linear arithmetic, rewriting
        with MEMBER-IMPLIES-PLUS-TREE-GREATEREQP and CAR-CONS, and
        expanding the definitions of FIX, MEANING, and PLUS-TREE, to:

              T.

      Case 1.1.1.1.
              (IMPLIES (AND (LISTP Y)
			    (NOT (EQUAL X (CAR Y)))
			    (NUMBERP (MEANING (CADR Y) A))
			    (NOT (EQUAL X (CADR Y)))
			    (EQUAL (MEANING (CADR Y) A)
				   (DIFFERENCE (MEANING (CADR Y) A)
					       (MEANING X A)))
			    (MEMBER X (CDR Y))
			    (LISTP (CDR Y))
			    (NOT (LISTP (CDDR Y)))
			    (EQUAL (MEANING (CAR Y) A) 0)
			    (NOT (EQUAL (MEANING (CADR Y) A) 0))
			    (NOT (EQUAL (MEANING X A) 0)))
		       (NOT (NUMBERP (MEANING X A)))),

        which we again simplify, using linear arithmetic, to:

              (IMPLIES (AND (LESSP (MEANING (CADR Y) A)
				   (MEANING X A))
			    (LISTP Y)
			    (NOT (EQUAL X (CAR Y)))
			    (NUMBERP (MEANING (CADR Y) A))
			    (NOT (EQUAL X (CADR Y)))
			    (EQUAL (MEANING (CADR Y) A)
				   (DIFFERENCE (MEANING (CADR Y) A)
					       (MEANING X A)))
			    (MEMBER X (CDR Y))
			    (LISTP (CDR Y))
			    (NOT (LISTP (CDDR Y)))
			    (EQUAL (MEANING (CAR Y) A) 0)
			    (NOT (EQUAL (MEANING (CADR Y) A) 0))
			    (NOT (EQUAL (MEANING X A) 0)))
		       (NOT (NUMBERP (MEANING X A)))),

        which finally simplifies, using linear arithmetic, applying
        MEMBER-IMPLIES-PLUS-TREE-GREATEREQP and CAR-CONS, and
        expanding the functions FIX, MEANING, and PLUS-TREE, to:

              T.


     That finishes the proof of *1.  Q.E.D.


[ 39.829009 6.2509888 ]

PLUS-TREE-DELETE 


(PROVE-LEMMA SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP
	     (REWRITE)
	     (IMPLIES (SUBBAGP X Y)
		      ( LEQ
			(MEANING (PLUS-TREE X) A)
			(MEANING (PLUS-TREE Y) A))))

WARNING:  When the linear lemma SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP
is stored under (MEANING (PLUS-TREE Y) A) it contains the free
variable X which will be chosen by instantiating the hypothesis
(SUBBAGP X Y).


WARNING:  When the linear lemma SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP
is stored under (MEANING (PLUS-TREE X) A) it contains the free
variable Y which will be chosen by instantiating the hypothesis
(SUBBAGP X Y).


     Name the conjecture *1.


     We will try to prove it by induction.  There are three plausible
inductions.  They merge into two likely candidate inductions.
However, only one is unflawed.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (LISTP X)
			 (MEMBER (CAR X) Y)
			 (P (DELETE (CAR X) Y) A (CDR X)))
		    (P Y A X))
	   (IMPLIES (AND (LISTP X)
			 (NOT (MEMBER (CAR X) Y)))
		    (P Y A X))
	   (IMPLIES (NOT (LISTP X)) (P Y A X))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  Note, however, the inductive
instance chosen for Y.  The above induction scheme generates the
following four new formulas:

Case 4. (IMPLIES (AND (LISTP X)
		      (MEMBER (CAR X) Y)
		      (NOT (SUBBAGP (CDR X) (DELETE (CAR X) Y)))
		      (SUBBAGP X Y))
		 ( LEQ
		   (MEANING (PLUS-TREE X) A)
		   (MEANING (PLUS-TREE Y) A))),

  which simplifies, expanding the definition of SUBBAGP, to:

        T.

Case 3. (IMPLIES (AND (LISTP X)
		      (MEMBER (CAR X) Y)
		      ( LEQ
			(MEANING (PLUS-TREE (CDR X)) A)
			(MEANING (PLUS-TREE (DELETE (CAR X) Y))
				 A))
		      (SUBBAGP X Y))
		 ( LEQ
		   (MEANING (PLUS-TREE X) A)
		   (MEANING (PLUS-TREE Y) A))),

  which we simplify, rewriting with PLUS-TREE-DELETE, and unfolding
  the functions SUBBAGP and PLUS-TREE, to the following three new
  formulas:

  Case 3.3.
          (IMPLIES (AND (LISTP X)
			(MEMBER (CAR X) Y)
			( LEQ
			  (MEANING (PLUS-TREE (CDR X)) A)
			  (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				      (MEANING (CAR X) A)))
			(SUBBAGP (CDR X) (DELETE (CAR X) Y))
			(NOT (LISTP (CDR X))))
		   ( LEQ
		     (MEANING (LIST 'FIX (CAR X)) A)
		     (MEANING (PLUS-TREE Y) A))).

    But this again simplifies, rewriting with CAR-CONS, and expanding
    MEANING and FIX, to two new formulas:

    Case 3.3.2.
            (IMPLIES (AND (LISTP X)
			  (MEMBER (CAR X) Y)
			  ( LEQ
			    (MEANING (PLUS-TREE (CDR X)) A)
			    (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					(MEANING (CAR X) A)))
			  (SUBBAGP (CDR X) (DELETE (CAR X) Y))
			  (NOT (LISTP (CDR X)))
			  (NOT (NUMBERP (MEANING (CAR X) A))))
		     ( LEQ 0 (MEANING (PLUS-TREE Y) A))),

      which we again simplify, using linear arithmetic, to:

            T.

    Case 3.3.1.
            (IMPLIES (AND (LISTP X)
			  (MEMBER (CAR X) Y)
			  ( LEQ
			    (MEANING (PLUS-TREE (CDR X)) A)
			    (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					(MEANING (CAR X) A)))
			  (SUBBAGP (CDR X) (DELETE (CAR X) Y))
			  (NOT (LISTP (CDR X)))
			  (NUMBERP (MEANING (CAR X) A)))
		     ( LEQ
		       (MEANING (CAR X) A)
		       (MEANING (PLUS-TREE Y) A))),

      which again simplifies, using linear arithmetic and applying
      MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

            T.

  Case 3.2.
          (IMPLIES (AND (LISTP X)
			(MEMBER (CAR X) Y)
			( LEQ
			  (MEANING (PLUS-TREE (CDR X)) A)
			  (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				      (MEANING (CAR X) A)))
			(SUBBAGP (CDR X) (DELETE (CAR X) Y))
			(LISTP (CDR X))
			(LISTP (CDDR X)))
		   ( LEQ
		     (MEANING (LIST 'PLUS
				    (CAR X)
				    (PLUS-TREE (CDR X)))
			      A)
		     (MEANING (PLUS-TREE Y) A))),

    which we again simplify, rewriting with CAR-CONS and CDR-CONS,
    and unfolding MEANING, to:

          (IMPLIES (AND (LISTP X)
			(MEMBER (CAR X) Y)
			( LEQ
			  (MEANING (PLUS-TREE (CDR X)) A)
			  (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				      (MEANING (CAR X) A)))
			(SUBBAGP (CDR X) (DELETE (CAR X) Y))
			(LISTP (CDR X))
			(LISTP (CDDR X)))
		   ( LEQ
		     (PLUS (MEANING (CAR X) A)
			   (MEANING (PLUS-TREE (CDR X)) A))
		     (MEANING (PLUS-TREE Y) A))).

    However this simplifies again, using linear arithmetic, to:

          (IMPLIES (AND (LESSP (MEANING (PLUS-TREE Y) A)
			       (MEANING (CAR X) A))
			(LISTP X)
			(MEMBER (CAR X) Y)
			( LEQ
			  (MEANING (PLUS-TREE (CDR X)) A)
			  (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				      (MEANING (CAR X) A)))
			(SUBBAGP (CDR X) (DELETE (CAR X) Y))
			(LISTP (CDR X))
			(LISTP (CDDR X)))
		   ( LEQ
		     (PLUS (MEANING (CAR X) A)
			   (MEANING (PLUS-TREE (CDR X)) A))
		     (MEANING (PLUS-TREE Y) A))).

    However this again simplifies, using linear arithmetic and
    rewriting with the lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

          T.

  Case 3.1.
          (IMPLIES (AND (LISTP X)
			(MEMBER (CAR X) Y)
			( LEQ
			  (MEANING (PLUS-TREE (CDR X)) A)
			  (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				      (MEANING (CAR X) A)))
			(SUBBAGP (CDR X) (DELETE (CAR X) Y))
			(LISTP (CDR X))
			(NOT (LISTP (CDDR X))))
		   ( LEQ
		     (MEANING (LIST 'PLUS (CAR X) (CADR X))
			      A)
		     (MEANING (PLUS-TREE Y) A))).

    This simplifies again, applying CAR-CONS and CDR-CONS, and
    unfolding MEANING, to the conjecture:

          (IMPLIES (AND (LISTP X)
			(MEMBER (CAR X) Y)
			( LEQ
			  (MEANING (PLUS-TREE (CDR X)) A)
			  (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				      (MEANING (CAR X) A)))
			(SUBBAGP (CDR X) (DELETE (CAR X) Y))
			(LISTP (CDR X))
			(NOT (LISTP (CDDR X))))
		   ( LEQ
		     (PLUS (MEANING (CAR X) A)
			   (MEANING (CADR X) A))
		     (MEANING (PLUS-TREE Y) A))),

    which further simplifies, rewriting with CAR-CONS and
    PLUS-RIGHT-ID2, and expanding the definitions of PLUS-TREE,
    MEANING, and FIX, to the following three new conjectures:

    Case 3.1.3.
            (IMPLIES (AND (LISTP X)
			  (MEMBER (CAR X) Y)
			  (NOT (NUMBERP (MEANING (CADR X) A)))
			  ( LEQ 0
			    (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					(MEANING (CAR X) A)))
			  (SUBBAGP (CDR X) (DELETE (CAR X) Y))
			  (LISTP (CDR X))
			  (NOT (LISTP (CDDR X)))
			  (NOT (NUMBERP (MEANING (CAR X) A))))
		     ( LEQ 0 (MEANING (PLUS-TREE Y) A))).

      But this again simplifies, using linear arithmetic, to:

            T.

    Case 3.1.2.
            (IMPLIES (AND (LISTP X)
			  (MEMBER (CAR X) Y)
			  (NOT (NUMBERP (MEANING (CADR X) A)))
			  ( LEQ 0
			    (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					(MEANING (CAR X) A)))
			  (SUBBAGP (CDR X) (DELETE (CAR X) Y))
			  (LISTP (CDR X))
			  (NOT (LISTP (CDDR X)))
			  (NUMBERP (MEANING (CAR X) A)))
		     ( LEQ
		       (MEANING (CAR X) A)
		       (MEANING (PLUS-TREE Y) A))),

      which we again simplify, using linear arithmetic and applying
      the lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

            T.

    Case 3.1.1.
            (IMPLIES (AND (LISTP X)
			  (MEMBER (CAR X) Y)
			  (NUMBERP (MEANING (CADR X) A))
			  ( LEQ
			    (MEANING (CADR X) A)
			    (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					(MEANING (CAR X) A)))
			  (SUBBAGP (CDR X) (DELETE (CAR X) Y))
			  (LISTP (CDR X))
			  (NOT (LISTP (CDDR X))))
		     ( LEQ
		       (PLUS (MEANING (CAR X) A)
			     (MEANING (CADR X) A))
		       (MEANING (PLUS-TREE Y) A))),

      which we again simplify, using linear arithmetic, to:

            (IMPLIES (AND (LESSP (MEANING (PLUS-TREE Y) A)
				 (MEANING (CAR X) A))
			  (LISTP X)
			  (MEMBER (CAR X) Y)
			  (NUMBERP (MEANING (CADR X) A))
			  ( LEQ
			    (MEANING (CADR X) A)
			    (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					(MEANING (CAR X) A)))
			  (SUBBAGP (CDR X) (DELETE (CAR X) Y))
			  (LISTP (CDR X))
			  (NOT (LISTP (CDDR X))))
		     ( LEQ
		       (PLUS (MEANING (CAR X) A)
			     (MEANING (CADR X) A))
		       (MEANING (PLUS-TREE Y) A))),

      which we again simplify, using linear arithmetic and appealing
      to the lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

            T.

Case 2. (IMPLIES (AND (LISTP X)
		      (NOT (MEMBER (CAR X) Y))
		      (SUBBAGP X Y))
		 ( LEQ
		   (MEANING (PLUS-TREE X) A)
		   (MEANING (PLUS-TREE Y) A))),

  which we simplify, expanding the definition of SUBBAGP, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP X)) (SUBBAGP X Y))
		 ( LEQ
		   (MEANING (PLUS-TREE X) A)
		   (MEANING (PLUS-TREE Y) A))),

  which we simplify, rewriting with the lemma SUBBAGP-CDR2, and
  opening up the definitions of SUBBAGP, PLUS-TREE, MEANING, CAR,
  EQUAL, and LESSP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 6.250002 0.880000815 ]

SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP 


(PROVE-LEMMA PLUS-TREE-BAGDIFF
	     (REWRITE)
	     (IMPLIES (SUBBAGP X Y)
		      (EQUAL (MEANING (PLUS-TREE (BAGDIFF Y X)) A)
			     (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					 (MEANING (PLUS-TREE X) A)))))

     Name the conjecture *1.


     We will try to prove it by induction.  Four inductions are
suggested by terms in the conjecture.  They merge into two likely
candidate inductions.  However, only one is unflawed.  We will induct
according to the following scheme:
      (AND (IMPLIES (AND (LISTP X)
			 (MEMBER (CAR X) Y)
			 (P (DELETE (CAR X) Y) (CDR X) A))
		    (P Y X A))
	   (IMPLIES (AND (LISTP X)
			 (NOT (MEMBER (CAR X) Y))
			 (P Y (CDR X) A))
		    (P Y X A))
	   (IMPLIES (NOT (LISTP X)) (P Y X A))).
Linear arithmetic and the lemma CDR-LESSP can be used to prove that
the measure (COUNT X) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  Note, however,
the inductive instances chosen for Y.  The above induction scheme
produces five new formulas:

Case 5. (IMPLIES (AND (LISTP X)
		      (MEMBER (CAR X) Y)
		      (NOT (SUBBAGP (CDR X) (DELETE (CAR X) Y)))
		      (SUBBAGP X Y))
		 (EQUAL (MEANING (PLUS-TREE (BAGDIFF Y X)) A)
			(DIFFERENCE (MEANING (PLUS-TREE Y) A)
				    (MEANING (PLUS-TREE X) A)))).

  This simplifies, opening up the definition of SUBBAGP, to:

        T.

Case 4. (IMPLIES
	 (AND
	  (LISTP X)
	  (MEMBER (CAR X) Y)
	  (EQUAL
	     (MEANING (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	     (DIFFERENCE (MEANING (PLUS-TREE (DELETE (CAR X) Y))
				  A)
			 (MEANING (PLUS-TREE (CDR X)) A)))
	  (SUBBAGP X Y))
	 (EQUAL (MEANING (PLUS-TREE (BAGDIFF Y X)) A)
		(DIFFERENCE (MEANING (PLUS-TREE Y) A)
			    (MEANING (PLUS-TREE X) A)))),

  which we simplify, rewriting with the lemma PLUS-TREE-DELETE, and
  unfolding the functions SUBBAGP, BAGDIFF, and PLUS-TREE, to the
  following three new formulas:

  Case 4.3.
          (IMPLIES
	   (AND
	    (LISTP X)
	    (MEMBER (CAR X) Y)
	    (EQUAL
	     (MEANING (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	     (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				     (MEANING (CAR X) A))
			 (MEANING (PLUS-TREE (CDR X)) A)))
	    (SUBBAGP (CDR X) (DELETE (CAR X) Y))
	    (NOT (LISTP (CDR X))))
	   (EQUAL
	     (MEANING (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	     (DIFFERENCE (MEANING (PLUS-TREE Y) A)
			 (MEANING (LIST 'FIX (CAR X)) A)))).

    But this again simplifies, rewriting with CAR-CONS, and expanding
    MEANING and FIX, to two new formulas:

    Case 4.3.2.
            (IMPLIES
	     (AND
	      (LISTP X)
	      (MEMBER (CAR X) Y)
	      (EQUAL
	       (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	       (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				       (MEANING (CAR X) A))
			   (MEANING (PLUS-TREE (CDR X)) A)))
	      (SUBBAGP (CDR X) (DELETE (CAR X) Y))
	      (NOT (LISTP (CDR X)))
	      (NOT (NUMBERP (MEANING (CAR X) A))))
	     (EQUAL
	      (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	      (DIFFERENCE (MEANING (PLUS-TREE Y) A)
			  0))),

      which we again simplify, using linear arithmetic, applying
      NUMBERP-MEANING-PLUS-TREE, DIFFERENCE-CANCELLATION-0, and
      DIFFERENCE-0, and expanding the definitions of DIFFERENCE and
      EQUAL, to:

            (IMPLIES
	     (AND
	      (LISTP X)
	      (MEMBER (CAR X) Y)
	      (NOT (EQUAL (MEANING (PLUS-TREE Y) A) 0))
	      (EQUAL
	       (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	       (DIFFERENCE (MEANING (PLUS-TREE Y) A)
			   (MEANING (PLUS-TREE (CDR X)) A)))
	      (SUBBAGP (CDR X) (DELETE (CAR X) Y))
	      (NOT (LISTP (CDR X)))
	      (NOT (NUMBERP (MEANING (CAR X) A))))
	     (EQUAL 0
		    (MEANING (PLUS-TREE (CDR X)) A))),

      which we further simplify, rewriting with
      NUMBERP-MEANING-PLUS-TREE, PLUS-TREE-DELETE, and SUBBAGP-CDR2,
      and unfolding the definitions of BAGDIFF, DIFFERENCE, PLUS-TREE,
      MEANING, CAR, EQUAL, and SUBBAGP, to:

            T.

    Case 4.3.1.
            (IMPLIES
	     (AND
	      (LISTP X)
	      (MEMBER (CAR X) Y)
	      (EQUAL
	       (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	       (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				       (MEANING (CAR X) A))
			   (MEANING (PLUS-TREE (CDR X)) A)))
	      (SUBBAGP (CDR X) (DELETE (CAR X) Y))
	      (NOT (LISTP (CDR X)))
	      (NUMBERP (MEANING (CAR X) A)))
	     (EQUAL
	      (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	      (DIFFERENCE (MEANING (PLUS-TREE Y) A)
			  (MEANING (CAR X) A)))).

      However this simplifies further, applying PLUS-TREE-DELETE,
      EQUAL-DIFFERENCE-0, and SUBBAGP-CDR2, and opening up BAGDIFF,
      PLUS-TREE, MEANING, CAR, EQUAL, DIFFERENCE, and SUBBAGP, to:

            T.

  Case 4.2.
          (IMPLIES
	   (AND
	    (LISTP X)
	    (MEMBER (CAR X) Y)
	    (EQUAL
	     (MEANING (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	     (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				     (MEANING (CAR X) A))
			 (MEANING (PLUS-TREE (CDR X)) A)))
	    (SUBBAGP (CDR X) (DELETE (CAR X) Y))
	    (LISTP (CDR X))
	    (LISTP (CDDR X)))
	   (EQUAL
	     (MEANING (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	     (DIFFERENCE (MEANING (PLUS-TREE Y) A)
			 (MEANING (LIST 'PLUS
					(CAR X)
					(PLUS-TREE (CDR X)))
				  A)))).

    But this simplifies again, rewriting with CAR-CONS and CDR-CONS,
    and expanding the function MEANING, to:

          (IMPLIES
	   (AND
	    (LISTP X)
	    (MEMBER (CAR X) Y)
	    (EQUAL
	     (MEANING (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	     (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				     (MEANING (CAR X) A))
			 (MEANING (PLUS-TREE (CDR X)) A)))
	    (SUBBAGP (CDR X) (DELETE (CAR X) Y))
	    (LISTP (CDR X))
	    (LISTP (CDDR X)))
	   (EQUAL
	     (MEANING (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	     (DIFFERENCE (MEANING (PLUS-TREE Y) A)
			 (PLUS (MEANING (CAR X) A)
			       (MEANING (PLUS-TREE (CDR X)) A))))),

    which we again simplify, using linear arithmetic, to four new
    formulas:

    Case 4.2.4.
            (IMPLIES
	     (AND
	      (LESSP (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				 (MEANING (CAR X) A))
		     (MEANING (PLUS-TREE (CDR X)) A))
	      (LISTP X)
	      (MEMBER (CAR X) Y)
	      (EQUAL
	       (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	       (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				       (MEANING (CAR X) A))
			   (MEANING (PLUS-TREE (CDR X)) A)))
	      (SUBBAGP (CDR X) (DELETE (CAR X) Y))
	      (LISTP (CDR X))
	      (LISTP (CDDR X)))
	     (EQUAL
	      (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	      (DIFFERENCE (MEANING (PLUS-TREE Y) A)
			  (PLUS (MEANING (CAR X) A)
				(MEANING (PLUS-TREE (CDR X)) A))))),

      which we again simplify, using linear arithmetic and rewriting
      with the lemmas SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP and
      PLUS-TREE-DELETE, to:

            (IMPLIES
	     (AND
	      (LESSP (MEANING (PLUS-TREE Y) A)
		     (MEANING (CAR X) A))
	      (LESSP (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				 (MEANING (CAR X) A))
		     (MEANING (PLUS-TREE (CDR X)) A))
	      (LISTP X)
	      (MEMBER (CAR X) Y)
	      (EQUAL
	       (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	       (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				       (MEANING (CAR X) A))
			   (MEANING (PLUS-TREE (CDR X)) A)))
	      (SUBBAGP (CDR X) (DELETE (CAR X) Y))
	      (LISTP (CDR X))
	      (LISTP (CDDR X)))
	     (EQUAL
	      (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	      (DIFFERENCE (MEANING (PLUS-TREE Y) A)
			  (PLUS (MEANING (CAR X) A)
				(MEANING (PLUS-TREE (CDR X)) A))))),

      which again simplifies, using linear arithmetic and applying
      MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

            T.

    Case 4.2.3.
            (IMPLIES
	     (AND
	      (LESSP (MEANING (PLUS-TREE Y) A)
		     (MEANING (CAR X) A))
	      (LISTP X)
	      (MEMBER (CAR X) Y)
	      (EQUAL
	       (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	       (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				       (MEANING (CAR X) A))
			   (MEANING (PLUS-TREE (CDR X)) A)))
	      (SUBBAGP (CDR X) (DELETE (CAR X) Y))
	      (LISTP (CDR X))
	      (LISTP (CDDR X)))
	     (EQUAL
	      (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	      (DIFFERENCE (MEANING (PLUS-TREE Y) A)
			  (PLUS (MEANING (CAR X) A)
				(MEANING (PLUS-TREE (CDR X)) A))))).

      But this again simplifies, using linear arithmetic and applying
      MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

            T.

    Case 4.2.2.
            (IMPLIES
	     (AND
	      (NOT
	       (NUMBERP
		(MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)))
	      (LISTP X)
	      (MEMBER (CAR X) Y)
	      (EQUAL
	       (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	       (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				       (MEANING (CAR X) A))
			   (MEANING (PLUS-TREE (CDR X)) A)))
	      (SUBBAGP (CDR X) (DELETE (CAR X) Y))
	      (LISTP (CDR X))
	      (LISTP (CDDR X)))
	     (EQUAL
	      (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	      (DIFFERENCE (MEANING (PLUS-TREE Y) A)
			  (PLUS (MEANING (CAR X) A)
				(MEANING (PLUS-TREE (CDR X)) A))))),

      which again simplifies, clearly, to:

            T.

    Case 4.2.1.
            (IMPLIES
	     (AND
	      (LESSP (MEANING (PLUS-TREE Y) A)
		     (PLUS (MEANING (CAR X) A)
			   (MEANING (PLUS-TREE (CDR X)) A)))
	      (LISTP X)
	      (MEMBER (CAR X) Y)
	      (EQUAL
	       (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	       (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				       (MEANING (CAR X) A))
			   (MEANING (PLUS-TREE (CDR X)) A)))
	      (SUBBAGP (CDR X) (DELETE (CAR X) Y))
	      (LISTP (CDR X))
	      (LISTP (CDDR X)))
	     (EQUAL
	      (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	      (DIFFERENCE (MEANING (PLUS-TREE Y) A)
			  (PLUS (MEANING (CAR X) A)
				(MEANING (PLUS-TREE (CDR X)) A))))),

      which we again simplify, using linear arithmetic, to two new
      goals:

      Case 4.2.1.2.
              (IMPLIES
	       (AND
		(LESSP (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				   (MEANING (CAR X) A))
		       (MEANING (PLUS-TREE (CDR X)) A))
		(LESSP (MEANING (PLUS-TREE Y) A)
		       (PLUS (MEANING (CAR X) A)
			     (MEANING (PLUS-TREE (CDR X)) A)))
		(LISTP X)
		(MEMBER (CAR X) Y)
		(EQUAL
		 (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		 (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					 (MEANING (CAR X) A))
			     (MEANING (PLUS-TREE (CDR X)) A)))
		(SUBBAGP (CDR X) (DELETE (CAR X) Y))
		(LISTP (CDR X))
		(LISTP (CDDR X)))
	       (EQUAL
		(MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		(DIFFERENCE (MEANING (PLUS-TREE Y) A)
			    (PLUS (MEANING (CAR X) A)
				  (MEANING (PLUS-TREE (CDR X)) A))))),

        which we again simplify, using linear arithmetic and applying
        the lemmas SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP and
        PLUS-TREE-DELETE, to the new conjecture:

              (IMPLIES
	       (AND
		(LESSP (MEANING (PLUS-TREE Y) A)
		       (MEANING (CAR X) A))
		(LESSP (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				   (MEANING (CAR X) A))
		       (MEANING (PLUS-TREE (CDR X)) A))
		(LESSP (MEANING (PLUS-TREE Y) A)
		       (PLUS (MEANING (CAR X) A)
			     (MEANING (PLUS-TREE (CDR X)) A)))
		(LISTP X)
		(MEMBER (CAR X) Y)
		(EQUAL
		 (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		 (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					 (MEANING (CAR X) A))
			     (MEANING (PLUS-TREE (CDR X)) A)))
		(SUBBAGP (CDR X) (DELETE (CAR X) Y))
		(LISTP (CDR X))
		(LISTP (CDDR X)))
	       (EQUAL
		(MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		(DIFFERENCE (MEANING (PLUS-TREE Y) A)
			    (PLUS (MEANING (CAR X) A)
				  (MEANING (PLUS-TREE (CDR X)) A))))),

        which we again simplify, using linear arithmetic and
        rewriting with the lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP,
        to:

              T.

      Case 4.2.1.1.
              (IMPLIES
	       (AND
		(LESSP (MEANING (PLUS-TREE Y) A)
		       (MEANING (CAR X) A))
		(LESSP (MEANING (PLUS-TREE Y) A)
		       (PLUS (MEANING (CAR X) A)
			     (MEANING (PLUS-TREE (CDR X)) A)))
		(LISTP X)
		(MEMBER (CAR X) Y)
		(EQUAL
		 (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		 (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					 (MEANING (CAR X) A))
			     (MEANING (PLUS-TREE (CDR X)) A)))
		(SUBBAGP (CDR X) (DELETE (CAR X) Y))
		(LISTP (CDR X))
		(LISTP (CDDR X)))
	       (EQUAL
		(MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		(DIFFERENCE (MEANING (PLUS-TREE Y) A)
			    (PLUS (MEANING (CAR X) A)
				  (MEANING (PLUS-TREE (CDR X)) A))))).

        This simplifies again, using linear arithmetic and applying
        MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

              T.

  Case 4.1.
          (IMPLIES
	   (AND
	    (LISTP X)
	    (MEMBER (CAR X) Y)
	    (EQUAL
	     (MEANING (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	     (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				     (MEANING (CAR X) A))
			 (MEANING (PLUS-TREE (CDR X)) A)))
	    (SUBBAGP (CDR X) (DELETE (CAR X) Y))
	    (LISTP (CDR X))
	    (NOT (LISTP (CDDR X))))
	   (EQUAL
	     (MEANING (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	     (DIFFERENCE (MEANING (PLUS-TREE Y) A)
			 (MEANING (LIST 'PLUS (CAR X) (CADR X))
				  A)))),

    which we again simplify, applying CAR-CONS and CDR-CONS, and
    expanding MEANING, to:

          (IMPLIES
	   (AND
	    (LISTP X)
	    (MEMBER (CAR X) Y)
	    (EQUAL
	     (MEANING (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	     (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				     (MEANING (CAR X) A))
			 (MEANING (PLUS-TREE (CDR X)) A)))
	    (SUBBAGP (CDR X) (DELETE (CAR X) Y))
	    (LISTP (CDR X))
	    (NOT (LISTP (CDDR X))))
	   (EQUAL
	     (MEANING (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	     (DIFFERENCE (MEANING (PLUS-TREE Y) A)
			 (PLUS (MEANING (CAR X) A)
			       (MEANING (CADR X) A))))).

    But this further simplifies, applying CAR-CONS and PLUS-RIGHT-ID2,
    and opening up the definitions of PLUS-TREE, MEANING, and FIX, to
    three new goals:

    Case 4.1.3.
            (IMPLIES
	     (AND
	      (LISTP X)
	      (MEMBER (CAR X) Y)
	      (NOT (NUMBERP (MEANING (CADR X) A)))
	      (EQUAL
	       (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	       (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				       (MEANING (CAR X) A))
			   0))
	      (SUBBAGP (CDR X) (DELETE (CAR X) Y))
	      (LISTP (CDR X))
	      (NOT (LISTP (CDDR X)))
	      (NOT (NUMBERP (MEANING (CAR X) A))))
	     (EQUAL
	      (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	      (DIFFERENCE (MEANING (PLUS-TREE Y) A)
			  0))),

      which again simplifies, using linear arithmetic, appealing to
      the lemmas NUMBERP-MEANING-PLUS-TREE and DIFFERENCE-0, and
      opening up DIFFERENCE and EQUAL, to:

            T.

    Case 4.1.2.
            (IMPLIES
	     (AND
	      (LISTP X)
	      (MEMBER (CAR X) Y)
	      (NOT (NUMBERP (MEANING (CADR X) A)))
	      (EQUAL
	       (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	       (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				       (MEANING (CAR X) A))
			   0))
	      (SUBBAGP (CDR X) (DELETE (CAR X) Y))
	      (LISTP (CDR X))
	      (NOT (LISTP (CDDR X)))
	      (NUMBERP (MEANING (CAR X) A)))
	     (EQUAL
	      (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	      (DIFFERENCE (MEANING (PLUS-TREE Y) A)
			  (MEANING (CAR X) A)))).

      This simplifies again, using linear arithmetic, to the
      following three new conjectures:

      Case 4.1.2.3.
              (IMPLIES
	       (AND
		(LESSP (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				   (MEANING (CAR X) A))
		       0)
		(LISTP X)
		(MEMBER (CAR X) Y)
		(NOT (NUMBERP (MEANING (CADR X) A)))
		(EQUAL
		 (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		 (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					 (MEANING (CAR X) A))
			     0))
		(SUBBAGP (CDR X) (DELETE (CAR X) Y))
		(LISTP (CDR X))
		(NOT (LISTP (CDDR X)))
		(NUMBERP (MEANING (CAR X) A)))
	       (EQUAL
		(MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		(DIFFERENCE (MEANING (PLUS-TREE Y) A)
			    (MEANING (CAR X) A)))),

        which again simplifies, using linear arithmetic and rewriting
        with MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

              T.

      Case 4.1.2.2.
              (IMPLIES
	       (AND
		(LESSP (MEANING (PLUS-TREE Y) A)
		       (MEANING (CAR X) A))
		(LISTP X)
		(MEMBER (CAR X) Y)
		(NOT (NUMBERP (MEANING (CADR X) A)))
		(EQUAL
		 (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		 (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					 (MEANING (CAR X) A))
			     0))
		(SUBBAGP (CDR X) (DELETE (CAR X) Y))
		(LISTP (CDR X))
		(NOT (LISTP (CDDR X)))
		(NUMBERP (MEANING (CAR X) A)))
	       (EQUAL
		(MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		(DIFFERENCE (MEANING (PLUS-TREE Y) A)
			    (MEANING (CAR X) A)))),

        which again simplifies, using linear arithmetic and rewriting
        with MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

              T.

      Case 4.1.2.1.
              (IMPLIES
	       (AND
		(NOT
		 (NUMBERP
		  (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)))
		(LISTP X)
		(MEMBER (CAR X) Y)
		(NOT (NUMBERP (MEANING (CADR X) A)))
		(EQUAL
		 (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		 (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					 (MEANING (CAR X) A))
			     0))
		(SUBBAGP (CDR X) (DELETE (CAR X) Y))
		(LISTP (CDR X))
		(NOT (LISTP (CDDR X)))
		(NUMBERP (MEANING (CAR X) A)))
	       (EQUAL
		(MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		(DIFFERENCE (MEANING (PLUS-TREE Y) A)
			    (MEANING (CAR X) A)))),

        which we again simplify, trivially, to:

              T.

    Case 4.1.1.
            (IMPLIES
	     (AND
	      (LISTP X)
	      (MEMBER (CAR X) Y)
	      (NUMBERP (MEANING (CADR X) A))
	      (EQUAL
	       (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	       (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				       (MEANING (CAR X) A))
			   (MEANING (CADR X) A)))
	      (SUBBAGP (CDR X) (DELETE (CAR X) Y))
	      (LISTP (CDR X))
	      (NOT (LISTP (CDDR X))))
	     (EQUAL
	      (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
	      (DIFFERENCE (MEANING (PLUS-TREE Y) A)
			  (PLUS (MEANING (CAR X) A)
				(MEANING (CADR X) A))))),

      which again simplifies, using linear arithmetic, to the
      following four new goals:

      Case 4.1.1.4.
              (IMPLIES
	       (AND
		(LESSP (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				   (MEANING (CAR X) A))
		       (MEANING (CADR X) A))
		(LISTP X)
		(MEMBER (CAR X) Y)
		(NUMBERP (MEANING (CADR X) A))
		(EQUAL
		 (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		 (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					 (MEANING (CAR X) A))
			     (MEANING (CADR X) A)))
		(SUBBAGP (CDR X) (DELETE (CAR X) Y))
		(LISTP (CDR X))
		(NOT (LISTP (CDDR X))))
	       (EQUAL
		(MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		(DIFFERENCE (MEANING (PLUS-TREE Y) A)
			    (PLUS (MEANING (CAR X) A)
				  (MEANING (CADR X) A))))).

        However this again simplifies, using linear arithmetic,
        rewriting with DIFFERENCE-0, and opening up the function
        EQUAL, to:

              (IMPLIES
	       (AND
		(LESSP (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				   (MEANING (CAR X) A))
		       (MEANING (CADR X) A))
		(LISTP X)
		(MEMBER (CAR X) Y)
		(NUMBERP (MEANING (CADR X) A))
		(LESSP (MEANING (PLUS-TREE Y) A)
		       (MEANING (CAR X) A))
		(EQUAL
		 (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		 (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					 (MEANING (CAR X) A))
			     (MEANING (CADR X) A)))
		(SUBBAGP (CDR X) (DELETE (CAR X) Y))
		(LISTP (CDR X))
		(NOT (LISTP (CDDR X))))
	       (EQUAL
		(MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		0)).

        This finally simplifies, using linear arithmetic and
        appealing to the lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP,
        to:

              T.

      Case 4.1.1.3.
              (IMPLIES
	       (AND
		(LESSP (MEANING (PLUS-TREE Y) A)
		       (MEANING (CAR X) A))
		(LISTP X)
		(MEMBER (CAR X) Y)
		(NUMBERP (MEANING (CADR X) A))
		(EQUAL
		 (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		 (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					 (MEANING (CAR X) A))
			     (MEANING (CADR X) A)))
		(SUBBAGP (CDR X) (DELETE (CAR X) Y))
		(LISTP (CDR X))
		(NOT (LISTP (CDDR X))))
	       (EQUAL
		(MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		(DIFFERENCE (MEANING (PLUS-TREE Y) A)
			    (PLUS (MEANING (CAR X) A)
				  (MEANING (CADR X) A))))).

        However this again simplifies, using linear arithmetic and
        applying MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

              T.

      Case 4.1.1.2.
              (IMPLIES
	       (AND
		(NOT
		 (NUMBERP
		  (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)))
		(LISTP X)
		(MEMBER (CAR X) Y)
		(NUMBERP (MEANING (CADR X) A))
		(EQUAL
		 (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		 (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					 (MEANING (CAR X) A))
			     (MEANING (CADR X) A)))
		(SUBBAGP (CDR X) (DELETE (CAR X) Y))
		(LISTP (CDR X))
		(NOT (LISTP (CDDR X))))
	       (EQUAL
		(MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		(DIFFERENCE (MEANING (PLUS-TREE Y) A)
			    (PLUS (MEANING (CAR X) A)
				  (MEANING (CADR X) A))))).

        This again simplifies, obviously, to:

              T.

      Case 4.1.1.1.
              (IMPLIES
	       (AND
		(LESSP (MEANING (PLUS-TREE Y) A)
		       (PLUS (MEANING (CAR X) A)
			     (MEANING (CADR X) A)))
		(LISTP X)
		(MEMBER (CAR X) Y)
		(NUMBERP (MEANING (CADR X) A))
		(EQUAL
		 (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		 (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					 (MEANING (CAR X) A))
			     (MEANING (CADR X) A)))
		(SUBBAGP (CDR X) (DELETE (CAR X) Y))
		(LISTP (CDR X))
		(NOT (LISTP (CDDR X))))
	       (EQUAL
		(MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		(DIFFERENCE (MEANING (PLUS-TREE Y) A)
			    (PLUS (MEANING (CAR X) A)
				  (MEANING (CADR X) A))))),

        which again simplifies, using linear arithmetic, to the
        following two new conjectures:

        Case 4.1.1.1.2.
                (IMPLIES
		 (AND
		  (LESSP (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				     (MEANING (CAR X) A))
			 (MEANING (CADR X) A))
		  (LESSP (MEANING (PLUS-TREE Y) A)
			 (PLUS (MEANING (CAR X) A)
			       (MEANING (CADR X) A)))
		  (LISTP X)
		  (MEMBER (CAR X) Y)
		  (NUMBERP (MEANING (CADR X) A))
		  (EQUAL
		   (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		   (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					   (MEANING (CAR X) A))
			       (MEANING (CADR X) A)))
		  (SUBBAGP (CDR X) (DELETE (CAR X) Y))
		  (LISTP (CDR X))
		  (NOT (LISTP (CDDR X))))
		 (EQUAL
		  (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		  (DIFFERENCE (MEANING (PLUS-TREE Y) A)
			      (PLUS (MEANING (CAR X) A)
				    (MEANING (CADR X) A))))).

          This simplifies again, using linear arithmetic, applying
          DIFFERENCE-0, and expanding the function EQUAL, to:

                (IMPLIES
		 (AND
		  (LESSP (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				     (MEANING (CAR X) A))
			 (MEANING (CADR X) A))
		  (LESSP (MEANING (PLUS-TREE Y) A)
			 (PLUS (MEANING (CAR X) A)
			       (MEANING (CADR X) A)))
		  (LISTP X)
		  (MEMBER (CAR X) Y)
		  (NUMBERP (MEANING (CADR X) A))
		  (LESSP (MEANING (PLUS-TREE Y) A)
			 (MEANING (CAR X) A))
		  (EQUAL
		   (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		   (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					   (MEANING (CAR X) A))
			       (MEANING (CADR X) A)))
		  (SUBBAGP (CDR X) (DELETE (CAR X) Y))
		  (LISTP (CDR X))
		  (NOT (LISTP (CDDR X))))
		 (EQUAL
		  (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		  0)).

          But this finally simplifies, using linear arithmetic and
          rewriting with MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

                T.

        Case 4.1.1.1.1.
                (IMPLIES
		 (AND
		  (LESSP (MEANING (PLUS-TREE Y) A)
			 (MEANING (CAR X) A))
		  (LESSP (MEANING (PLUS-TREE Y) A)
			 (PLUS (MEANING (CAR X) A)
			       (MEANING (CADR X) A)))
		  (LISTP X)
		  (MEMBER (CAR X) Y)
		  (NUMBERP (MEANING (CADR X) A))
		  (EQUAL
		   (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		   (DIFFERENCE (DIFFERENCE (MEANING (PLUS-TREE Y) A)
					   (MEANING (CAR X) A))
			       (MEANING (CADR X) A)))
		  (SUBBAGP (CDR X) (DELETE (CAR X) Y))
		  (LISTP (CDR X))
		  (NOT (LISTP (CDDR X))))
		 (EQUAL
		  (MEANING
		      (PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
		      A)
		  (DIFFERENCE (MEANING (PLUS-TREE Y) A)
			      (PLUS (MEANING (CAR X) A)
				    (MEANING (CADR X) A))))).

          However this finally simplifies, using linear arithmetic
          and rewriting with MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:

                T.

Case 3. (IMPLIES (AND (LISTP X)
		      (NOT (MEMBER (CAR X) Y))
		      (NOT (SUBBAGP (CDR X) Y))
		      (SUBBAGP X Y))
		 (EQUAL (MEANING (PLUS-TREE (BAGDIFF Y X)) A)
			(DIFFERENCE (MEANING (PLUS-TREE Y) A)
				    (MEANING (PLUS-TREE X) A)))).

  This simplifies, opening up the function SUBBAGP, to:

        T.

Case 2. (IMPLIES
	     (AND (LISTP X)
		  (NOT (MEMBER (CAR X) Y))
		  (EQUAL (MEANING (PLUS-TREE (BAGDIFF Y (CDR X)))
				  A)
			 (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				     (MEANING (PLUS-TREE (CDR X)) A)))
		  (SUBBAGP X Y))
	     (EQUAL (MEANING (PLUS-TREE (BAGDIFF Y X)) A)
		    (DIFFERENCE (MEANING (PLUS-TREE Y) A)
				(MEANING (PLUS-TREE X) A)))),

  which simplifies, unfolding the function SUBBAGP, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP X)) (SUBBAGP X Y))
		 (EQUAL (MEANING (PLUS-TREE (BAGDIFF Y X)) A)
			(DIFFERENCE (MEANING (PLUS-TREE Y) A)
				    (MEANING (PLUS-TREE X) A)))),

  which we simplify, rewriting with SUBBAGP-CDR2 and
  NUMBERP-MEANING-PLUS-TREE, and expanding SUBBAGP, BAGDIFF,
  PLUS-TREE, MEANING, CAR, EQUAL, and DIFFERENCE, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 36.340989 2.5690104 ]

PLUS-TREE-BAGDIFF 


(PROVE-LEMMA NUMBERP-MEANING-BRIDGE
	     (REWRITE)
	     (IMPLIES (EQUAL (MEANING Z A)
			     (MEANING (PLUS-TREE X) A))
		      (NUMBERP (MEANING Z A))))

WARNING:  Note that NUMBERP-MEANING-BRIDGE contains the free variable
X which will be chosen by instantiating the hypothesis:
      (EQUAL (MEANING Z A)
	     (MEANING (PLUS-TREE X) A))
.

.

We use the above equality hypothesis by substituting:
      (MEANING (PLUS-TREE X) A)
for (MEANING Z A) and keeping the equality hypothesis.  We would thus
like to prove:

      (IMPLIES (EQUAL (MEANING Z A)
		      (MEANING (PLUS-TREE X) A))
	       (NUMBERP (MEANING (PLUS-TREE X) A))),

which simplifies, trivially, to:

      (IMPLIES (EQUAL (MEANING Z A)
		      (MEANING (PLUS-TREE X) A))
	       (NUMBERP (MEANING Z A))),

which we would usually push and work on later by induction.  But if
we must use induction to prove the input conjecture, we prefer to
induct on the original formulation of the problem.  Thus we will
disregard all that we have previously done, give the name *1 to the
original input, and work on it.


     So now let us return to:

(IMPLIES (EQUAL (MEANING Z A)
		(MEANING (PLUS-TREE X) A))
	 (NUMBERP (MEANING Z A))).

We named this *1.  Let us appeal to the induction principle.  There
is only one plausible induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (NLISTP X) (P Z A X))
	   (IMPLIES (AND (NOT (NLISTP X))
			 (NLISTP (CDR X)))
		    (P Z A X))
	   (IMPLIES (AND (NOT (NLISTP X))
			 (NOT (NLISTP (CDR X)))
			 (NLISTP (CDDR X)))
		    (P Z A X))
	   (IMPLIES (AND (NOT (NLISTP X))
			 (NOT (NLISTP (CDR X)))
			 (NOT (NLISTP (CDDR X)))
			 (P Z A (CDR X)))
		    (P Z A X))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP establish that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme produces the following
four new formulas:

Case 4. (IMPLIES (AND (NLISTP X)
		      (EQUAL (MEANING Z A)
			     (MEANING (PLUS-TREE X) A)))
		 (NUMBERP (MEANING Z A))),

  which simplifies, unfolding the functions NLISTP, PLUS-TREE,
  MEANING, and CAR, to:

        T.

Case 3. (IMPLIES (AND (NOT (NLISTP X))
		      (NLISTP (CDR X))
		      (EQUAL (MEANING Z A)
			     (MEANING (PLUS-TREE X) A)))
		 (NUMBERP (MEANING Z A))).

  This simplifies, rewriting with CAR-CONS, and expanding NLISTP,
  PLUS-TREE, MEANING, and FIX, to:

        T.

Case 2. (IMPLIES (AND (NOT (NLISTP X))
		      (NOT (NLISTP (CDR X)))
		      (NLISTP (CDDR X))
		      (EQUAL (MEANING Z A)
			     (MEANING (PLUS-TREE X) A)))
		 (NUMBERP (MEANING Z A))),

  which we simplify, rewriting with the lemmas CAR-CONS and CDR-CONS,
  and expanding the definitions of NLISTP, PLUS-TREE, and MEANING, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP X))
		      (NOT (NLISTP (CDR X)))
		      (NOT (NLISTP (CDDR X)))
		      (NOT (EQUAL (MEANING Z A)
				  (MEANING (PLUS-TREE (CDR X)) A)))
		      (EQUAL (MEANING Z A)
			     (MEANING (PLUS-TREE X) A)))
		 (NUMBERP (MEANING Z A))),

  which we simplify, rewriting with the lemmas CAR-CONS and CDR-CONS,
  and unfolding NLISTP, PLUS-TREE, and MEANING, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.57099609 0.37900187 ]

NUMBERP-MEANING-BRIDGE 


(PROVE-LEMMA BRIDGE-TO-SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP
	     (REWRITE)
	     (IMPLIES (AND (SUBBAGP Y (PLUS-FRINGE Z))
			   (EQUAL (MEANING Z A)
				  (MEANING (PLUS-TREE (PLUS-FRINGE Z))
					   A)))
		      (EQUAL (LESSP (MEANING Z A)
				    (MEANING (PLUS-TREE Y) A))
			     F)))
This simplifies, using linear arithmetic and rewriting with
SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP, to:

      T.

Q.E.D.


[ 0.649003096 0.017997233 ]

BRIDGE-TO-SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP 


(PROVE-LEMMA MEANING-PLUS-TREE-APPEND
	     (REWRITE)
	     (EQUAL (MEANING (PLUS-TREE (APPEND X Y)) A)
		    (PLUS (MEANING (PLUS-TREE X) A)
			  (MEANING (PLUS-TREE Y) A))))

     Give the conjecture the name *1.


     We will appeal to induction.  There are three plausible
inductions.  They merge into two likely candidate inductions.
However, only one is unflawed.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (LISTP X) (P (CDR X) Y A))
		    (P X Y A))
	   (IMPLIES (NOT (LISTP X)) (P X Y A))).
Linear arithmetic and the lemma CDR-LESSP can be used to establish
that the measure (COUNT X) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme produces two new conjectures:

Case 2. (IMPLIES (AND (LISTP X)
		      (EQUAL (MEANING (PLUS-TREE (APPEND (CDR X) Y))
				      A)
			     (PLUS (MEANING (PLUS-TREE (CDR X)) A)
				   (MEANING (PLUS-TREE Y) A))))
		 (EQUAL (MEANING (PLUS-TREE (APPEND X Y)) A)
			(PLUS (MEANING (PLUS-TREE X) A)
			      (MEANING (PLUS-TREE Y) A)))).

  This simplifies, appealing to the lemmas COMMUTATIVITY-OF-PLUS,
  CAR-CONS, and CDR-CONS, and expanding APPEND and PLUS-TREE, to the
  following nine new conjectures:

  Case 2.9.
          (IMPLIES (AND (LISTP X)
			(EQUAL (MEANING (PLUS-TREE (APPEND (CDR X) Y))
					A)
			       (PLUS (MEANING (PLUS-TREE Y) A)
				     (MEANING (PLUS-TREE (CDR X)) A)))
			(NOT (LISTP (CDR X)))
			(NOT (LISTP (APPEND (CDR X) Y))))
		   (EQUAL (MEANING (LIST 'FIX (CAR X)) A)
			  (PLUS (MEANING (PLUS-TREE Y) A)
				(MEANING (LIST 'FIX (CAR X)) A)))).

    This simplifies again, applying NUMBERP-MEANING-PLUS-TREE,
    PLUS-EQUAL-0, and CAR-CONS, and opening up PLUS-TREE, MEANING,
    CAR, FIX, EQUAL, and PLUS, to:

          T.

  Case 2.8.
          (IMPLIES
		 (AND (LISTP X)
		      (EQUAL (MEANING (PLUS-TREE (APPEND (CDR X) Y))
				      A)
			     (PLUS (MEANING (PLUS-TREE Y) A)
				   (MEANING (PLUS-TREE (CDR X)) A)))
		      (NOT (LISTP (CDR X)))
		      (LISTP (APPEND (CDR X) Y))
		      (LISTP (CDR (APPEND (CDR X) Y))))
		 (EQUAL (MEANING (LIST 'PLUS
				       (CAR X)
				       (PLUS-TREE (APPEND (CDR X) Y)))
				 A)
			(PLUS (MEANING (PLUS-TREE Y) A)
			      (MEANING (LIST 'FIX (CAR X)) A)))),

    which we again simplify, rewriting with CAR-CONS and CDR-CONS,
    and unfolding the functions MEANING and FIX, to the following two
    new goals:

    Case 2.8.2.
            (IMPLIES
		  (AND (LISTP X)
		       (EQUAL (MEANING (PLUS-TREE (APPEND (CDR X) Y))
				       A)
			      (PLUS (MEANING (PLUS-TREE Y) A)
				    (MEANING (PLUS-TREE (CDR X)) A)))
		       (NOT (LISTP (CDR X)))
		       (LISTP (APPEND (CDR X) Y))
		       (LISTP (CDR (APPEND (CDR X) Y)))
		       (NOT (NUMBERP (MEANING (CAR X) A))))
		  (EQUAL (PLUS (MEANING (CAR X) A)
			       (MEANING (PLUS-TREE (APPEND (CDR X) Y))
					A))
			 (PLUS (MEANING (PLUS-TREE Y) A) 0))),

      which again simplifies, rewriting with
      NUMBERP-MEANING-PLUS-TREE and COMMUTATIVITY-OF-PLUS, and
      expanding PLUS and EQUAL, to the new conjecture:

            (IMPLIES
		   (AND (LISTP X)
			(EQUAL (MEANING (PLUS-TREE (APPEND (CDR X) Y))
					A)
			       (PLUS (MEANING (PLUS-TREE Y) A)
				     (MEANING (PLUS-TREE (CDR X)) A)))
			(NOT (LISTP (CDR X)))
			(LISTP (APPEND (CDR X) Y))
			(LISTP (CDR (APPEND (CDR X) Y)))
			(NOT (NUMBERP (MEANING (CAR X) A))))
		   (EQUAL (MEANING (PLUS-TREE (APPEND (CDR X) Y))
				   A)
			  (MEANING (PLUS-TREE Y) A))).

      This simplifies further, rewriting with the lemmas
      NUMBERP-MEANING-PLUS-TREE and COMMUTATIVITY-OF-PLUS, and
      unfolding APPEND, PLUS-TREE, MEANING, CAR, EQUAL, and PLUS, to:

            T.

    Case 2.8.1.
            (IMPLIES
		  (AND (LISTP X)
		       (EQUAL (MEANING (PLUS-TREE (APPEND (CDR X) Y))
				       A)
			      (PLUS (MEANING (PLUS-TREE Y) A)
				    (MEANING (PLUS-TREE (CDR X)) A)))
		       (NOT (LISTP (CDR X)))
		       (LISTP (APPEND (CDR X) Y))
		       (LISTP (CDR (APPEND (CDR X) Y)))
		       (NUMBERP (MEANING (CAR X) A)))
		  (EQUAL (PLUS (MEANING (CAR X) A)
			       (MEANING (PLUS-TREE (APPEND (CDR X) Y))
					A))
			 (PLUS (MEANING (PLUS-TREE Y) A)
			       (MEANING (CAR X) A)))),

      which again simplifies, rewriting with COMMUTATIVITY-OF-PLUS,
      NUMBERP-MEANING-PLUS-TREE, and PLUS-CANCELLATION, to:

            (IMPLIES
		   (AND (LISTP X)
			(EQUAL (MEANING (PLUS-TREE (APPEND (CDR X) Y))
					A)
			       (PLUS (MEANING (PLUS-TREE Y) A)
				     (MEANING (PLUS-TREE (CDR X)) A)))
			(NOT (LISTP (CDR X)))
			(LISTP (APPEND (CDR X) Y))
			(LISTP (CDR (APPEND (CDR X) Y)))
			(NUMBERP (MEANING (CAR X) A)))
		   (EQUAL (MEANING (PLUS-TREE (APPEND (CDR X) Y))
				   A)
			  (MEANING (PLUS-TREE Y) A))).

      But this simplifies further, applying NUMBERP-MEANING-PLUS-TREE
      and COMMUTATIVITY-OF-PLUS, and opening up APPEND, PLUS-TREE,
      MEANING, CAR, EQUAL, and PLUS, to:

            T.

  Case 2.7.
          (IMPLIES (AND (LISTP X)
			(EQUAL (MEANING (PLUS-TREE (APPEND (CDR X) Y))
					A)
			       (PLUS (MEANING (PLUS-TREE Y) A)
				     (MEANING (PLUS-TREE (CDR X)) A)))
			(NOT (LISTP (CDR X)))
			(LISTP (APPEND (CDR X) Y))
			(NOT (LISTP (CDR (APPEND (CDR X) Y)))))
		   (EQUAL (MEANING (LIST 'PLUS
					 (CAR X)
					 (CAR (APPEND (CDR X) Y)))
				   A)
			  (PLUS (MEANING (PLUS-TREE Y) A)
				(MEANING (LIST 'FIX (CAR X)) A)))).

    This simplifies again, applying CAR-CONS, CDR-CONS, and
    PLUS-RIGHT-ID2, and unfolding PLUS-TREE, MEANING, and FIX, to
    four new formulas:

    Case 2.7.4.
            (IMPLIES
	     (AND (LISTP X)
		  (NOT (NUMBERP (MEANING (CAR (APPEND (CDR X) Y)) A)))
		  (EQUAL 0
			 (PLUS (MEANING (PLUS-TREE Y) A)
			       (MEANING (PLUS-TREE (CDR X)) A)))
		  (NOT (LISTP (CDR X)))
		  (LISTP (APPEND (CDR X) Y))
		  (NOT (LISTP (CDR (APPEND (CDR X) Y))))
		  (NOT (NUMBERP (MEANING (CAR X) A))))
	     (EQUAL 0
		    (PLUS (MEANING (PLUS-TREE Y) A) 0))),

      which we again simplify, using linear arithmetic, to:

            T.

    Case 2.7.3.
            (IMPLIES
	     (AND (LISTP X)
		  (NOT (NUMBERP (MEANING (CAR (APPEND (CDR X) Y)) A)))
		  (EQUAL 0
			 (PLUS (MEANING (PLUS-TREE Y) A)
			       (MEANING (PLUS-TREE (CDR X)) A)))
		  (NOT (LISTP (CDR X)))
		  (LISTP (APPEND (CDR X) Y))
		  (NOT (LISTP (CDR (APPEND (CDR X) Y))))
		  (NUMBERP (MEANING (CAR X) A)))
	     (EQUAL (MEANING (CAR X) A)
		    (PLUS (MEANING (PLUS-TREE Y) A)
			  (MEANING (CAR X) A)))).

      However this again simplifies, using linear arithmetic, to:

            T.

    Case 2.7.2.
            (IMPLIES
		   (AND (LISTP X)
			(NUMBERP (MEANING (CAR (APPEND (CDR X) Y)) A))
			(EQUAL (MEANING (CAR (APPEND (CDR X) Y)) A)
			       (PLUS (MEANING (PLUS-TREE Y) A)
				     (MEANING (PLUS-TREE (CDR X)) A)))
			(NOT (LISTP (CDR X)))
			(LISTP (APPEND (CDR X) Y))
			(NOT (LISTP (CDR (APPEND (CDR X) Y))))
			(NOT (NUMBERP (MEANING (CAR X) A))))
		   (EQUAL (PLUS (MEANING (CAR X) A)
				(MEANING (CAR (APPEND (CDR X) Y)) A))
			  (PLUS (MEANING (PLUS-TREE Y) A) 0))),

      which again simplifies, applying NUMBERP-MEANING-PLUS-TREE and
      COMMUTATIVITY-OF-PLUS, and opening up the functions PLUS and
      EQUAL, to:

            (IMPLIES
		   (AND (LISTP X)
			(EQUAL (MEANING (CAR (APPEND (CDR X) Y)) A)
			       (PLUS (MEANING (PLUS-TREE Y) A)
				     (MEANING (PLUS-TREE (CDR X)) A)))
			(NOT (LISTP (CDR X)))
			(LISTP (APPEND (CDR X) Y))
			(NOT (LISTP (CDR (APPEND (CDR X) Y))))
			(NOT (NUMBERP (MEANING (CAR X) A))))
		   (EQUAL (MEANING (CAR (APPEND (CDR X) Y)) A)
			  (MEANING (PLUS-TREE Y) A))),

      which we further simplify, applying the lemmas
      NUMBERP-MEANING-PLUS-TREE, COMMUTATIVITY-OF-PLUS, CAR-CONS, and
      NUMBERP-MEANING-BRIDGE, and opening up the definitions of
      APPEND, PLUS-TREE, MEANING, CAR, EQUAL, PLUS, and FIX, to:

            T.

    Case 2.7.1.
            (IMPLIES
		   (AND (LISTP X)
			(NUMBERP (MEANING (CAR (APPEND (CDR X) Y)) A))
			(EQUAL (MEANING (CAR (APPEND (CDR X) Y)) A)
			       (PLUS (MEANING (PLUS-TREE Y) A)
				     (MEANING (PLUS-TREE (CDR X)) A)))
			(NOT (LISTP (CDR X)))
			(LISTP (APPEND (CDR X) Y))
			(NOT (LISTP (CDR (APPEND (CDR X) Y))))
			(NUMBERP (MEANING (CAR X) A)))
		   (EQUAL (PLUS (MEANING (CAR X) A)
				(MEANING (CAR (APPEND (CDR X) Y)) A))
			  (PLUS (MEANING (PLUS-TREE Y) A)
				(MEANING (CAR X) A)))),

      which we again simplify, applying COMMUTATIVITY-OF-PLUS,
      NUMBERP-MEANING-PLUS-TREE, and PLUS-CANCELLATION, to the new
      conjecture:

            (IMPLIES
		   (AND (LISTP X)
			(EQUAL (MEANING (CAR (APPEND (CDR X) Y)) A)
			       (PLUS (MEANING (PLUS-TREE Y) A)
				     (MEANING (PLUS-TREE (CDR X)) A)))
			(NOT (LISTP (CDR X)))
			(LISTP (APPEND (CDR X) Y))
			(NOT (LISTP (CDR (APPEND (CDR X) Y))))
			(NUMBERP (MEANING (CAR X) A)))
		   (EQUAL (MEANING (CAR (APPEND (CDR X) Y)) A)
			  (MEANING (PLUS-TREE Y) A))),

      which we further simplify, applying NUMBERP-MEANING-PLUS-TREE,
      COMMUTATIVITY-OF-PLUS, CAR-CONS, and NUMBERP-MEANING-BRIDGE,
      and unfolding the functions APPEND, PLUS-TREE, MEANING, CAR,
      EQUAL, PLUS, and FIX, to:

            T.

  Case 2.6.
          (IMPLIES (AND (LISTP X)
			(EQUAL (MEANING (PLUS-TREE (APPEND (CDR X) Y))
					A)
			       (PLUS (MEANING (PLUS-TREE Y) A)
				     (MEANING (PLUS-TREE (CDR X)) A)))
			(LISTP (CDR X))
			(LISTP (CDDR X))
			(NOT (LISTP (APPEND (CDR X) Y))))
		   (EQUAL (MEANING (LIST 'FIX (CAR X)) A)
			  (PLUS (MEANING (PLUS-TREE Y) A)
				(MEANING (LIST 'PLUS
					       (CAR X)
					       (PLUS-TREE (CDR X)))
					 A)))).

    However this again simplifies, applying NUMBERP-MEANING-PLUS-TREE,
    PLUS-EQUAL-0, CAR-CONS, CDR-CONS, and COMMUTATIVITY-OF-PLUS, and
    opening up the definitions of PLUS-TREE, MEANING, CAR, FIX, EQUAL,
    and PLUS, to:

          T.

  Case 2.5.
          (IMPLIES
		 (AND (LISTP X)
		      (EQUAL (MEANING (PLUS-TREE (APPEND (CDR X) Y))
				      A)
			     (PLUS (MEANING (PLUS-TREE Y) A)
				   (MEANING (PLUS-TREE (CDR X)) A)))
		      (LISTP (CDR X))
		      (LISTP (CDDR X))
		      (LISTP (APPEND (CDR X) Y))
		      (LISTP (CDR (APPEND (CDR X) Y))))
		 (EQUAL (MEANING (LIST 'PLUS
				       (CAR X)
				       (PLUS-TREE (APPEND (CDR X) Y)))
				 A)
			(PLUS (MEANING (PLUS-TREE Y) A)
			      (MEANING (LIST 'PLUS
					     (CAR X)
					     (PLUS-TREE (CDR X)))
				       A)))),

    which we again simplify, applying CAR-CONS, CDR-CONS, and
    COMMUTATIVITY2-OF-PLUS, and expanding MEANING, to:

          T.

  Case 2.4.
          (IMPLIES (AND (LISTP X)
			(EQUAL (MEANING (PLUS-TREE (APPEND (CDR X) Y))
					A)
			       (PLUS (MEANING (PLUS-TREE Y) A)
				     (MEANING (PLUS-TREE (CDR X)) A)))
			(LISTP (CDR X))
			(LISTP (CDDR X))
			(LISTP (APPEND (CDR X) Y))
			(NOT (LISTP (CDR (APPEND (CDR X) Y)))))
		   (EQUAL (MEANING (LIST 'PLUS
					 (CAR X)
					 (CAR (APPEND (CDR X) Y)))
				   A)
			  (PLUS (MEANING (PLUS-TREE Y) A)
				(MEANING (LIST 'PLUS
					       (CAR X)
					       (PLUS-TREE (CDR X)))
					 A)))).

    This simplifies again, rewriting with CAR-CONS, CDR-CONS,
    PLUS-RIGHT-ID2, COMMUTATIVITY-OF-PLUS, and COMMUTATIVITY2-OF-PLUS,
    and expanding the functions PLUS-TREE, MEANING, FIX, EQUAL, and
    PLUS, to:

          T.

  Case 2.3.
          (IMPLIES
		  (AND (LISTP X)
		       (EQUAL (MEANING (PLUS-TREE (APPEND (CDR X) Y))
				       A)
			      (PLUS (MEANING (PLUS-TREE Y) A)
				    (MEANING (PLUS-TREE (CDR X)) A)))
		       (LISTP (CDR X))
		       (NOT (LISTP (CDDR X)))
		       (NOT (LISTP (APPEND (CDR X) Y))))
		  (EQUAL (MEANING (LIST 'FIX (CAR X)) A)
			 (PLUS (MEANING (PLUS-TREE Y) A)
			       (MEANING (LIST 'PLUS (CAR X) (CADR X))
					A)))),

    which we again simplify, applying the lemmas
    NUMBERP-MEANING-PLUS-TREE, PLUS-EQUAL-0, CAR-CONS, and CDR-CONS,
    and expanding the functions PLUS-TREE, MEANING, CAR, and FIX, to
    two new goals:

    Case 2.3.2.
            (IMPLIES (AND (LISTP X)
			  (EQUAL 0 (MEANING (PLUS-TREE Y) A))
			  (EQUAL 0
				 (MEANING (PLUS-TREE (CDR X)) A))
			  (LISTP (CDR X))
			  (NOT (LISTP (CDDR X)))
			  (NOT (LISTP (APPEND (CDR X) Y)))
			  (NOT (NUMBERP (MEANING (CAR X) A))))
		     (EQUAL 0
			    (PLUS 0
				  (PLUS (MEANING (CAR X) A)
					(MEANING (CADR X) A))))),

      which again simplifies, expanding PLUS and EQUAL, to:

            (IMPLIES (AND (LISTP X)
			  (EQUAL 0 (MEANING (PLUS-TREE Y) A))
			  (EQUAL 0
				 (MEANING (PLUS-TREE (CDR X)) A))
			  (LISTP (CDR X))
			  (NOT (LISTP (CDDR X)))
			  (NOT (LISTP (APPEND (CDR X) Y)))
			  (NOT (NUMBERP (MEANING (CAR X) A)))
			  (NUMBERP (MEANING (CADR X) A)))
		     (EQUAL 0 (MEANING (CADR X) A))).

      But this further simplifies, rewriting with CAR-CONS, and
      expanding the functions PLUS-TREE, MEANING, and FIX, to:

            T.

    Case 2.3.1.
            (IMPLIES (AND (LISTP X)
			  (EQUAL 0 (MEANING (PLUS-TREE Y) A))
			  (EQUAL 0
				 (MEANING (PLUS-TREE (CDR X)) A))
			  (LISTP (CDR X))
			  (NOT (LISTP (CDDR X)))
			  (NOT (LISTP (APPEND (CDR X) Y)))
			  (NUMBERP (MEANING (CAR X) A)))
		     (EQUAL (MEANING (CAR X) A)
			    (PLUS 0
				  (PLUS (MEANING (CAR X) A)
					(MEANING (CADR X) A))))).

      However this simplifies again, opening up EQUAL and PLUS, to:

            (IMPLIES (AND (LISTP X)
			  (EQUAL 0 (MEANING (PLUS-TREE Y) A))
			  (EQUAL 0
				 (MEANING (PLUS-TREE (CDR X)) A))
			  (LISTP (CDR X))
			  (NOT (LISTP (CDDR X)))
			  (NOT (LISTP (APPEND (CDR X) Y)))
			  (NUMBERP (MEANING (CAR X) A)))
		     (EQUAL (MEANING (CAR X) A)
			    (PLUS (MEANING (CAR X) A)
				  (MEANING (CADR X) A)))).

      But this further simplifies, rewriting with CAR-CONS,
      COMMUTATIVITY-OF-PLUS, and PLUS-RIGHT-ID2, and expanding
      PLUS-TREE, MEANING, FIX, EQUAL, and PLUS, to:

            T.

  Case 2.2.
          (IMPLIES
		 (AND (LISTP X)
		      (EQUAL (MEANING (PLUS-TREE (APPEND (CDR X) Y))
				      A)
			     (PLUS (MEANING (PLUS-TREE Y) A)
				   (MEANING (PLUS-TREE (CDR X)) A)))
		      (LISTP (CDR X))
		      (NOT (LISTP (CDDR X)))
		      (LISTP (APPEND (CDR X) Y))
		      (LISTP (CDR (APPEND (CDR X) Y))))
		 (EQUAL (MEANING (LIST 'PLUS
				       (CAR X)
				       (PLUS-TREE (APPEND (CDR X) Y)))
				 A)
			(PLUS (MEANING (PLUS-TREE Y) A)
			      (MEANING (LIST 'PLUS (CAR X) (CADR X))
				       A)))).

    But this again simplifies, rewriting with CAR-CONS, CDR-CONS,
    COMMUTATIVITY2-OF-PLUS, and PLUS-CANCELLATION, and expanding the
    definition of MEANING, to the new formula:

          (IMPLIES (AND (LISTP X)
			(EQUAL (MEANING (PLUS-TREE (APPEND (CDR X) Y))
					A)
			       (PLUS (MEANING (PLUS-TREE Y) A)
				     (MEANING (PLUS-TREE (CDR X)) A)))
			(LISTP (CDR X))
			(NOT (LISTP (CDDR X)))
			(LISTP (APPEND (CDR X) Y))
			(LISTP (CDR (APPEND (CDR X) Y))))
		   (EQUAL (MEANING (PLUS-TREE (APPEND (CDR X) Y))
				   A)
			  (PLUS (MEANING (PLUS-TREE Y) A)
				(MEANING (CADR X) A)))),

    which further simplifies, applying CAR-CONS,
    NUMBERP-MEANING-PLUS-TREE, COMMUTATIVITY-OF-PLUS, and
    PLUS-RIGHT-ID2, and unfolding PLUS-TREE, MEANING, FIX, EQUAL, and
    PLUS, to:

          T.

  Case 2.1.
          (IMPLIES
		  (AND (LISTP X)
		       (EQUAL (MEANING (PLUS-TREE (APPEND (CDR X) Y))
				       A)
			      (PLUS (MEANING (PLUS-TREE Y) A)
				    (MEANING (PLUS-TREE (CDR X)) A)))
		       (LISTP (CDR X))
		       (NOT (LISTP (CDDR X)))
		       (LISTP (APPEND (CDR X) Y))
		       (NOT (LISTP (CDR (APPEND (CDR X) Y)))))
		  (EQUAL (MEANING (LIST 'PLUS
					(CAR X)
					(CAR (APPEND (CDR X) Y)))
				  A)
			 (PLUS (MEANING (PLUS-TREE Y) A)
			       (MEANING (LIST 'PLUS (CAR X) (CADR X))
					A)))).

    However this simplifies again, applying CAR-CONS, CDR-CONS,
    PLUS-RIGHT-ID2, COMMUTATIVITY2-OF-PLUS, and PLUS-CANCELLATION,
    and unfolding the definitions of PLUS-TREE, MEANING, and FIX, to
    the following three new conjectures:

    Case 2.1.3.
            (IMPLIES
	     (AND (LISTP X)
		  (NOT (NUMBERP (MEANING (CAR (APPEND (CDR X) Y)) A)))
		  (EQUAL 0
			 (PLUS (MEANING (PLUS-TREE Y) A)
			       (MEANING (PLUS-TREE (CDR X)) A)))
		  (LISTP (CDR X))
		  (NOT (LISTP (CDDR X)))
		  (LISTP (APPEND (CDR X) Y))
		  (NOT (LISTP (CDR (APPEND (CDR X) Y))))
		  (NOT (NUMBERP (MEANING (CAR X) A))))
	     (EQUAL 0
		    (PLUS (MEANING (CAR X) A)
			  (PLUS (MEANING (PLUS-TREE Y) A)
				(MEANING (CADR X) A))))),

      which we again simplify, applying NUMBERP-MEANING-PLUS-TREE and
      PLUS-EQUAL-0, and opening up EQUAL and PLUS, to the formula:

            (IMPLIES
	     (AND (LISTP X)
		  (NOT (NUMBERP (MEANING (CAR (APPEND (CDR X) Y)) A)))
		  (EQUAL 0 (MEANING (PLUS-TREE Y) A))
		  (EQUAL 0
			 (MEANING (PLUS-TREE (CDR X)) A))
		  (LISTP (CDR X))
		  (NOT (LISTP (CDDR X)))
		  (LISTP (APPEND (CDR X) Y))
		  (NOT (LISTP (CDR (APPEND (CDR X) Y))))
		  (NOT (NUMBERP (MEANING (CAR X) A)))
		  (NUMBERP (MEANING (CADR X) A)))
	     (EQUAL 0 (MEANING (CADR X) A))).

      However this simplifies further, applying CAR-CONS, and
      unfolding the definitions of PLUS-TREE, MEANING, and FIX, to:

            T.

    Case 2.1.2.
            (IMPLIES
	     (AND (LISTP X)
		  (NOT (NUMBERP (MEANING (CAR (APPEND (CDR X) Y)) A)))
		  (EQUAL 0
			 (PLUS (MEANING (PLUS-TREE Y) A)
			       (MEANING (PLUS-TREE (CDR X)) A)))
		  (LISTP (CDR X))
		  (NOT (LISTP (CDDR X)))
		  (LISTP (APPEND (CDR X) Y))
		  (NOT (LISTP (CDR (APPEND (CDR X) Y))))
		  (NUMBERP (MEANING (CAR X) A)))
	     (EQUAL (MEANING (CAR X) A)
		    (PLUS (MEANING (CAR X) A)
			  (PLUS (MEANING (PLUS-TREE Y) A)
				(MEANING (CADR X) A))))).

      But this again simplifies, rewriting with the lemmas
      NUMBERP-MEANING-PLUS-TREE and PLUS-EQUAL-0, and unfolding the
      functions EQUAL and PLUS, to two new goals:

      Case 2.1.2.2.
              (IMPLIES
	       (AND
		  (LISTP X)
		  (NOT (NUMBERP (MEANING (CAR (APPEND (CDR X) Y)) A)))
		  (EQUAL 0 (MEANING (PLUS-TREE Y) A))
		  (EQUAL 0
			 (MEANING (PLUS-TREE (CDR X)) A))
		  (LISTP (CDR X))
		  (NOT (LISTP (CDDR X)))
		  (LISTP (APPEND (CDR X) Y))
		  (NOT (LISTP (CDR (APPEND (CDR X) Y))))
		  (NUMBERP (MEANING (CAR X) A))
		  (NOT (NUMBERP (MEANING (CADR X) A))))
	       (EQUAL (MEANING (CAR X) A)
		      (PLUS (MEANING (CAR X) A) 0))).

        This again simplifies, using linear arithmetic, to:

              T.

      Case 2.1.2.1.
              (IMPLIES
	       (AND
		  (LISTP X)
		  (NOT (NUMBERP (MEANING (CAR (APPEND (CDR X) Y)) A)))
		  (EQUAL 0 (MEANING (PLUS-TREE Y) A))
		  (EQUAL 0
			 (MEANING (PLUS-TREE (CDR X)) A))
		  (LISTP (CDR X))
		  (NOT (LISTP (CDDR X)))
		  (LISTP (APPEND (CDR X) Y))
		  (NOT (LISTP (CDR (APPEND (CDR X) Y))))
		  (NUMBERP (MEANING (CAR X) A))
		  (NUMBERP (MEANING (CADR X) A)))
	       (EQUAL (MEANING (CAR X) A)
		      (PLUS (MEANING (CAR X) A)
			    (MEANING (CADR X) A)))).

        This further simplifies, rewriting with CAR-CONS and
        COMMUTATIVITY-OF-PLUS, and opening up the functions PLUS-TREE,
        MEANING, FIX, NUMBERP, EQUAL, and PLUS, to:

              T.

    Case 2.1.1.
            (IMPLIES
		   (AND (LISTP X)
			(NUMBERP (MEANING (CAR (APPEND (CDR X) Y)) A))
			(EQUAL (MEANING (CAR (APPEND (CDR X) Y)) A)
			       (PLUS (MEANING (PLUS-TREE Y) A)
				     (MEANING (PLUS-TREE (CDR X)) A)))
			(LISTP (CDR X))
			(NOT (LISTP (CDDR X)))
			(LISTP (APPEND (CDR X) Y))
			(NOT (LISTP (CDR (APPEND (CDR X) Y)))))
		   (EQUAL (MEANING (CAR (APPEND (CDR X) Y)) A)
			  (PLUS (MEANING (PLUS-TREE Y) A)
				(MEANING (CADR X) A)))).

      Of course, this again simplifies, obviously, to:

            (IMPLIES
		   (AND (LISTP X)
			(EQUAL (MEANING (CAR (APPEND (CDR X) Y)) A)
			       (PLUS (MEANING (PLUS-TREE Y) A)
				     (MEANING (PLUS-TREE (CDR X)) A)))
			(LISTP (CDR X))
			(NOT (LISTP (CDDR X)))
			(LISTP (APPEND (CDR X) Y))
			(NOT (LISTP (CDR (APPEND (CDR X) Y)))))
		   (EQUAL (MEANING (CAR (APPEND (CDR X) Y)) A)
			  (PLUS (MEANING (PLUS-TREE Y) A)
				(MEANING (CADR X) A)))).

      This further simplifies, appealing to the lemmas CAR-CONS,
      NUMBERP-MEANING-PLUS-TREE, COMMUTATIVITY-OF-PLUS, and
      PLUS-RIGHT-ID2, and unfolding PLUS-TREE, MEANING, FIX, EQUAL,
      and PLUS, to:

            T.

Case 1. (IMPLIES (NOT (LISTP X))
		 (EQUAL (MEANING (PLUS-TREE (APPEND X Y)) A)
			(PLUS (MEANING (PLUS-TREE X) A)
			      (MEANING (PLUS-TREE Y) A)))).

  This simplifies, applying NUMBERP-MEANING-PLUS-TREE, and unfolding
  APPEND, PLUS-TREE, MEANING, CAR, EQUAL, and PLUS, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 14.4670004 2.09800008 ]

MEANING-PLUS-TREE-APPEND 


(PROVE-LEMMA PLUS-TREE-PLUS-FRINGE
	     (REWRITE)
	     (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE X))
			     A)
		    (FIX (MEANING X A))))
This formula simplifies, unfolding FIX, to the following two new
conjectures:

Case 2. (IMPLIES (NOT (NUMBERP (MEANING X A)))
		 (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE X))
				 A)
			0)),

  which we will name *1.

Case 1. (IMPLIES (NUMBERP (MEANING X A))
		 (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE X))
				 A)
			(MEANING X A))),

  which we would usually push and work on later by induction.  But if
  we must use induction to prove the input conjecture, we prefer to
  induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us consider:

(EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE X))
		A)
       (FIX (MEANING X A))).

We gave this the name *1 above.  Let us appeal to the induction
principle.  There is only one suggested induction.  We will induct
according to the following scheme:
      (AND (IMPLIES (AND (AND (LISTP X) (EQUAL (CAR X) 'PLUS))
			 (P (CADDR X) A)
			 (P (CADR X) A))
		    (P X A))
	   (IMPLIES (NOT (AND (LISTP X)
			      (EQUAL (CAR X) 'PLUS)))
		    (P X A))).
Linear arithmetic, the lemmas CAR-LESSEQP, CDR-LESSEQP, and CDR-LESSP,
and the definition of AND can be used to show that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
produces two new conjectures:

Case 2. (IMPLIES
	      (AND (AND (LISTP X) (EQUAL (CAR X) 'PLUS))
		   (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADDR X)))
				   A)
			  (FIX (MEANING (CADDR X) A)))
		   (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADR X)))
				   A)
			  (FIX (MEANING (CADR X) A))))
	      (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE X))
			      A)
		     (FIX (MEANING X A)))),

  which we simplify, rewriting with MEANING-PLUS-TREE-APPEND,
  NUMBERP-MEANING-PLUS, and COMMUTATIVITY-OF-PLUS, and unfolding the
  functions AND, FIX, PLUS-FRINGE, EQUAL, and PLUS, to the following
  four new formulas:

  Case 2.4.
          (IMPLIES
	      (AND (LISTP X)
		   (EQUAL (CAR X) 'PLUS)
		   (NOT (NUMBERP (MEANING (CADDR X) A)))
		   (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADDR X)))
				   A)
			  0)
		   (NOT (NUMBERP (MEANING (CADR X) A)))
		   (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADR X)))
				   A)
			  0))
	      (EQUAL 0 (MEANING X A))).

    Appealing to the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
    eliminate (CAR X) and (CDR X), V by (CONS D W) to eliminate
    (CDR V) and (CAR V), and W by (CONS V C) to eliminate (CAR W) and
    (CDR W).  This generates three new conjectures:

    Case 2.4.3.
            (IMPLIES
	       (AND (NOT (LISTP V))
		    (EQUAL Z 'PLUS)
		    (NOT (NUMBERP (MEANING (CADR V) A)))
		    (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADR V)))
				    A)
			   0)
		    (NOT (NUMBERP (MEANING (CAR V) A)))
		    (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CAR V)))
				    A)
			   0))
	       (EQUAL 0 (MEANING (CONS Z V) A))),

      which we further simplify, rewriting with CDR-NLISTP,
      CAR-NLISTP, and PLUS-RIGHT-ID2, and opening up CAR, MEANING,
      PLUS-FRINGE, PLUS-TREE, FIX, and EQUAL, to:

            T.

    Case 2.4.2.
            (IMPLIES
		(AND (NOT (LISTP W))
		     (EQUAL Z 'PLUS)
		     (NOT (NUMBERP (MEANING (CAR W) A)))
		     (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CAR W)))
				     A)
			    0)
		     (NOT (NUMBERP (MEANING D A)))
		     (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE D))
				     A)
			    0))
		(EQUAL 0
		       (MEANING (CONS Z (CONS D W)) A))),

      which further simplifies, applying CAR-NLISTP, CAR-CONS,
      CDR-CONS, PLUS-RIGHT-ID2, and COMMUTATIVITY-OF-PLUS, and
      expanding the functions MEANING, PLUS-FRINGE, PLUS-TREE, CAR,
      FIX, and EQUAL, to:

            T.

    Case 2.4.1.
            (IMPLIES (AND (EQUAL Z 'PLUS)
			  (NOT (NUMBERP (MEANING V A)))
			  (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE V))
					  A)
				 0)
			  (NOT (NUMBERP (MEANING D A)))
			  (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE D))
					  A)
				 0))
		     (EQUAL 0
			    (MEANING (CONS Z (CONS D (CONS V C)))
				     A))),

      which we further simplify, rewriting with CAR-CONS, CDR-CONS,
      and PLUS-RIGHT-ID2, and expanding the definitions of MEANING
      and EQUAL, to:

            T.

  Case 2.3.
          (IMPLIES
	      (AND (LISTP X)
		   (EQUAL (CAR X) 'PLUS)
		   (NOT (NUMBERP (MEANING (CADDR X) A)))
		   (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADDR X)))
				   A)
			  0)
		   (NUMBERP (MEANING (CADR X) A))
		   (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADR X)))
				   A)
			  (MEANING (CADR X) A)))
	      (EQUAL (MEANING (CADR X) A)
		     (MEANING X A))),

    which we again simplify, applying NUMBERP-MEANING-BRIDGE, to the
    new conjecture:

          (IMPLIES
	      (AND (LISTP X)
		   (EQUAL (CAR X) 'PLUS)
		   (NOT (NUMBERP (MEANING (CADDR X) A)))
		   (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADDR X)))
				   A)
			  0)
		   (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADR X)))
				   A)
			  (MEANING (CADR X) A)))
	      (EQUAL (MEANING (CADR X) A)
		     (MEANING X A))).

    Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V)
    to eliminate (CAR X) and (CDR X), V by (CONS D W) to eliminate
    (CDR V) and (CAR V), and W by (CONS V C) to eliminate (CAR W) and
    (CDR W).  We must thus prove three new goals:

    Case 2.3.3.
            (IMPLIES
	       (AND (NOT (LISTP V))
		    (EQUAL Z 'PLUS)
		    (NOT (NUMBERP (MEANING (CADR V) A)))
		    (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADR V)))
				    A)
			   0)
		    (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CAR V)))
				    A)
			   (MEANING (CAR V) A)))
	       (EQUAL (MEANING (CAR V) A)
		      (MEANING (CONS Z V) A))).

      However this simplifies further, rewriting with the lemmas
      CDR-NLISTP and CAR-NLISTP, and expanding the definitions of CAR,
      MEANING, PLUS-FRINGE, PLUS-TREE, FIX, and EQUAL, to:

            T.

    Case 2.3.2.
            (IMPLIES
		(AND (NOT (LISTP W))
		     (EQUAL Z 'PLUS)
		     (NOT (NUMBERP (MEANING (CAR W) A)))
		     (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CAR W)))
				     A)
			    0)
		     (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE D))
				     A)
			    (MEANING D A)))
		(EQUAL (MEANING D A)
		       (MEANING (CONS Z (CONS D W)) A))).

      However this further simplifies, applying CAR-NLISTP, CAR-CONS,
      CDR-CONS, NUMBERP-MEANING-BRIDGE, and COMMUTATIVITY-OF-PLUS,
      and opening up the definitions of MEANING, PLUS-FRINGE,
      PLUS-TREE, CAR, FIX, EQUAL, and PLUS, to:

            T.

    Case 2.3.1.
            (IMPLIES (AND (EQUAL Z 'PLUS)
			  (NOT (NUMBERP (MEANING V A)))
			  (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE V))
					  A)
				 0)
			  (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE D))
					  A)
				 (MEANING D A)))
		     (EQUAL (MEANING D A)
			    (MEANING (CONS Z (CONS D (CONS V C)))
				     A))).

      But this further simplifies, applying CAR-CONS, CDR-CONS,
      NUMBERP-MEANING-BRIDGE, and PLUS-RIGHT-ID2, and opening up the
      function MEANING, to:

            T.

  Case 2.2.
          (IMPLIES
	      (AND (LISTP X)
		   (EQUAL (CAR X) 'PLUS)
		   (NUMBERP (MEANING (CADDR X) A))
		   (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADDR X)))
				   A)
			  (MEANING (CADDR X) A))
		   (NOT (NUMBERP (MEANING (CADR X) A)))
		   (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADR X)))
				   A)
			  0))
	      (EQUAL (MEANING (CADDR X) A)
		     (MEANING X A))).

    But this simplifies again, applying NUMBERP-MEANING-BRIDGE, to
    the new goal:

          (IMPLIES
	      (AND (LISTP X)
		   (EQUAL (CAR X) 'PLUS)
		   (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADDR X)))
				   A)
			  (MEANING (CADDR X) A))
		   (NOT (NUMBERP (MEANING (CADR X) A)))
		   (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADR X)))
				   A)
			  0))
	      (EQUAL (MEANING (CADDR X) A)
		     (MEANING X A))).

    Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V)
    to eliminate (CAR X) and (CDR X), V by (CONS D W) to eliminate
    (CDR V) and (CAR V), and W by (CONS V C) to eliminate (CAR W) and
    (CDR W).  We thus obtain three new conjectures:

    Case 2.2.3.
            (IMPLIES
	       (AND (NOT (LISTP V))
		    (EQUAL Z 'PLUS)
		    (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADR V)))
				    A)
			   (MEANING (CADR V) A))
		    (NOT (NUMBERP (MEANING (CAR V) A)))
		    (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CAR V)))
				    A)
			   0))
	       (EQUAL (MEANING (CADR V) A)
		      (MEANING (CONS Z V) A))),

      which we further simplify, rewriting with the lemmas CDR-NLISTP
      and CAR-NLISTP, and opening up the definitions of CAR,
      PLUS-FRINGE, PLUS-TREE, MEANING, FIX, and NUMBERP, to:

            T.

    Case 2.2.2.
            (IMPLIES
		(AND (NOT (LISTP W))
		     (EQUAL Z 'PLUS)
		     (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CAR W)))
				     A)
			    (MEANING (CAR W) A))
		     (NOT (NUMBERP (MEANING D A)))
		     (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE D))
				     A)
			    0))
		(EQUAL (MEANING (CAR W) A)
		       (MEANING (CONS Z (CONS D W)) A))),

      which further simplifies, rewriting with the lemmas CAR-NLISTP,
      CAR-CONS, CDR-CONS, PLUS-RIGHT-ID2, and COMMUTATIVITY-OF-PLUS,
      and expanding the definitions of PLUS-FRINGE, PLUS-TREE,
      MEANING, CAR, FIX, NUMBERP, and EQUAL, to:

            T.

    Case 2.2.1.
            (IMPLIES (AND (EQUAL Z 'PLUS)
			  (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE V))
					  A)
				 (MEANING V A))
			  (NOT (NUMBERP (MEANING D A)))
			  (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE D))
					  A)
				 0))
		     (EQUAL (MEANING V A)
			    (MEANING (CONS Z (CONS D (CONS V C)))
				     A))).

      This further simplifies, rewriting with the lemmas CAR-CONS,
      CDR-CONS, and NUMBERP-MEANING-BRIDGE, and expanding the
      functions MEANING and PLUS, to:

            T.

  Case 2.1.
          (IMPLIES
	      (AND (LISTP X)
		   (EQUAL (CAR X) 'PLUS)
		   (NUMBERP (MEANING (CADDR X) A))
		   (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADDR X)))
				   A)
			  (MEANING (CADDR X) A))
		   (NUMBERP (MEANING (CADR X) A))
		   (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADR X)))
				   A)
			  (MEANING (CADR X) A)))
	      (EQUAL (PLUS (MEANING (CADR X) A)
			   (MEANING (CADDR X) A))
		     (MEANING X A))),

    which we again simplify, applying the lemma
    NUMBERP-MEANING-BRIDGE, to:

          (IMPLIES
	      (AND (LISTP X)
		   (EQUAL (CAR X) 'PLUS)
		   (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADDR X)))
				   A)
			  (MEANING (CADDR X) A))
		   (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADR X)))
				   A)
			  (MEANING (CADR X) A)))
	      (EQUAL (PLUS (MEANING (CADR X) A)
			   (MEANING (CADDR X) A))
		     (MEANING X A))).

    Appealing to the lemma CAR-CDR-ELIM, we now replace X by
    (CONS Z V) to eliminate (CAR X) and (CDR X), V by (CONS D W) to
    eliminate (CDR V) and (CAR V), and W by (CONS V C) to eliminate
    (CAR W) and (CDR W).  This generates three new conjectures:

    Case 2.1.3.
            (IMPLIES
	       (AND (NOT (LISTP V))
		    (EQUAL Z 'PLUS)
		    (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CADR V)))
				    A)
			   (MEANING (CADR V) A))
		    (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CAR V)))
				    A)
			   (MEANING (CAR V) A)))
	       (EQUAL (PLUS (MEANING (CAR V) A)
			    (MEANING (CADR V) A))
		      (MEANING (CONS Z V) A))),

      which we further simplify, rewriting with CDR-NLISTP and
      CAR-NLISTP, and expanding the functions CAR, PLUS-FRINGE,
      PLUS-TREE, MEANING, FIX, EQUAL, and PLUS, to:

            T.

    Case 2.1.2.
            (IMPLIES
		(AND (NOT (LISTP W))
		     (EQUAL Z 'PLUS)
		     (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE (CAR W)))
				     A)
			    (MEANING (CAR W) A))
		     (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE D))
				     A)
			    (MEANING D A)))
		(EQUAL (PLUS (MEANING D A)
			     (MEANING (CAR W) A))
		       (MEANING (CONS Z (CONS D W)) A))).

      However this simplifies further, rewriting with the lemmas
      CAR-NLISTP, NUMBERP-MEANING-BRIDGE, COMMUTATIVITY-OF-PLUS,
      CAR-CONS, and CDR-CONS, and unfolding the definitions of
      PLUS-FRINGE, PLUS-TREE, MEANING, CAR, FIX, EQUAL, and PLUS, to:

            T.

    Case 2.1.1.
            (IMPLIES (AND (EQUAL Z 'PLUS)
			  (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE V))
					  A)
				 (MEANING V A))
			  (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE D))
					  A)
				 (MEANING D A)))
		     (EQUAL (PLUS (MEANING D A) (MEANING V A))
			    (MEANING (CONS Z (CONS D (CONS V C)))
				     A))).

      However this further simplifies, appealing to the lemmas
      CAR-CONS and CDR-CONS, and opening up MEANING, to:

            T.

Case 1. (IMPLIES (NOT (AND (LISTP X)
			   (EQUAL (CAR X) 'PLUS)))
		 (EQUAL (MEANING (PLUS-TREE (PLUS-FRINGE X))
				 A)
			(FIX (MEANING X A)))).

  This simplifies, appealing to the lemmas CAR-CONS and CDR-CONS, and
  expanding AND, PLUS-FRINGE, LISTP, PLUS-TREE, MEANING, and FIX, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 8.7860006 1.44299927 ]

PLUS-TREE-PLUS-FRINGE 


(PROVE-LEMMA MEMBER-IMPLIES-NUMBERP
	     (REWRITE)
	     (IMPLIES (AND (MEMBER C (PLUS-FRINGE X))
			   (NUMBERP (MEANING C A)))
		      (NUMBERP (MEANING X A))))

WARNING:  Note that MEMBER-IMPLIES-NUMBERP contains the free variable
C which will be chosen by instantiating the hypothesis:
      (MEMBER C (PLUS-FRINGE X))
.


     Name the conjecture *1.


     We will try to prove it by induction.  There is only one
suggested induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (AND (AND (LISTP X) (EQUAL (CAR X) 'PLUS))
			 (P (CADDR X) A C)
			 (P (CADR X) A C))
		    (P X A C))
	   (IMPLIES (NOT (AND (LISTP X)
			      (EQUAL (CAR X) 'PLUS)))
		    (P X A C))).
Linear arithmetic, the lemmas CAR-LESSEQP, CDR-LESSEQP, and CDR-LESSP,
and the definition of AND inform us that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each
induction step of the scheme.  The above induction scheme generates
the following five new formulas:

Case 5. (IMPLIES (AND (AND (LISTP X) (EQUAL (CAR X) 'PLUS))
		      (NOT (MEMBER C (PLUS-FRINGE (CADDR X))))
		      (NOT (MEMBER C (PLUS-FRINGE (CADR X))))
		      (MEMBER C (PLUS-FRINGE X))
		      (NUMBERP (MEANING C A)))
		 (NUMBERP (MEANING X A))),

  which simplifies, applying NUMBERP-MEANING-PLUS, and expanding the
  definitions of AND, PLUS-FRINGE, and EQUAL, to:

        T.

Case 4. (IMPLIES (AND (AND (LISTP X) (EQUAL (CAR X) 'PLUS))
		      (NUMBERP (MEANING (CADDR X) A))
		      (NOT (MEMBER C (PLUS-FRINGE (CADR X))))
		      (MEMBER C (PLUS-FRINGE X))
		      (NUMBERP (MEANING C A)))
		 (NUMBERP (MEANING X A))),

  which simplifies, rewriting with NUMBERP-MEANING-PLUS, and opening
  up AND, PLUS-FRINGE, and EQUAL, to:

        T.

Case 3. (IMPLIES (AND (AND (LISTP X) (EQUAL (CAR X) 'PLUS))
		      (NOT (MEMBER C (PLUS-FRINGE (CADDR X))))
		      (NUMBERP (MEANING (CADR X) A))
		      (MEMBER C (PLUS-FRINGE X))
		      (NUMBERP (MEANING C A)))
		 (NUMBERP (MEANING X A))),

  which simplifies, appealing to the lemma NUMBERP-MEANING-PLUS, and
  unfolding the definitions of AND, PLUS-FRINGE, and EQUAL, to:

        T.

Case 2. (IMPLIES (AND (AND (LISTP X) (EQUAL (CAR X) 'PLUS))
		      (NUMBERP (MEANING (CADDR X) A))
		      (NUMBERP (MEANING (CADR X) A))
		      (MEMBER C (PLUS-FRINGE X))
		      (NUMBERP (MEANING C A)))
		 (NUMBERP (MEANING X A))),

  which we simplify, rewriting with NUMBERP-MEANING-PLUS, and opening
  up AND, PLUS-FRINGE, and EQUAL, to:

        T.

Case 1. (IMPLIES (AND (NOT (AND (LISTP X)
				(EQUAL (CAR X) 'PLUS)))
		      (MEMBER C (PLUS-FRINGE X))
		      (NUMBERP (MEANING C A)))
		 (NUMBERP (MEANING X A))),

  which simplifies, applying CDR-CONS and CAR-CONS, and expanding the
  functions AND, PLUS-FRINGE, MEMBER, and LISTP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.86000163 0.30999756 ]

MEMBER-IMPLIES-NUMBERP 


(PROVE-LEMMA CORRECTNESS-OF-CANCEL
	     ((META EQUAL))
	     (IMPLIES (FORMP X)
		      (AND (EQUAL (MEANING X A)
				  (MEANING (CANCEL X) A))
			   (FORMP (CANCEL X)))))
This formula simplifies, opening up the definitions of CANCEL and AND,
to the following ten new formulas:

Case 10.(IMPLIES
	 (AND (FORMP X)
	      (LISTP X)
	      (EQUAL (CAR X) 'EQUAL)
	      (NOT (EQUAL (CAADR X) 'PLUS))
	      (LISTP (CADDR X))
	      (EQUAL (CAADDR X) 'PLUS)
	      (MEMBER (CADR X)
		      (PLUS-FRINGE (CADDR X))))
	 (EQUAL
	  (MEANING X A)
	  (MEANING
	   (CONS 'IF
	    (CONS
	     (LIST 'NUMBERP (CADR X))
	     (CONS (LIST 'EQUAL
			 ''0
			 (PLUS-TREE (DELETE (CADR X)
					    (PLUS-FRINGE (CADDR X)))))
		   '('1FALSE))))
	   A))).

  But this simplifies again, applying CAR-CONS, CDR-CONS,
  MEMBER-IMPLIES-NUMBERP, PLUS-TREE-PLUS-FRINGE, PLUS-TREE-DELETE,
  and EQUAL-DIFFERENCE-0, and expanding MEANING and CAR, to the
  following three new goals:

  Case 10.3.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(NOT (EQUAL (CAADR X) 'PLUS))
			(LISTP (CADDR X))
			(EQUAL (CAADDR X) 'PLUS)
			(MEMBER (CADR X)
				(PLUS-FRINGE (CADDR X)))
			(LESSP (MEANING (CADR X) A)
			       (MEANING (CADDR X) A)))
		   (EQUAL (MEANING X A) F)),

    which again simplifies, obviously, to:

          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(NOT (EQUAL (CAADR X) 'PLUS))
			(LISTP (CADDR X))
			(EQUAL (CAADDR X) 'PLUS)
			(MEMBER (CADR X)
				(PLUS-FRINGE (CADDR X)))
			(LESSP (MEANING (CADR X) A)
			       (MEANING (CADDR X) A)))
		   (NOT (MEANING X A))).

    Appealing to the lemma CAR-CDR-ELIM, we now replace X by
    (CONS Z V) to eliminate (CAR X) and (CDR X), V by (CONS W D) to
    eliminate (CAR V) and (CDR V), W by (CONS V C) to eliminate
    (CAR W) and (CDR W), D by (CONS W X1) to eliminate (CAR D) and
    (CDR D), W by (CONS D Z1) to eliminate (CAR W) and (CDR W), D by
    (CONS V C) to eliminate (CAR D) and (CDR D), and V by (CONS D X1)
    to eliminate (CAR V) and (CDR V).  We would thus like to prove
    five new goals:

    Case 10.3.5.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'EQUAL)
			  (NOT (EQUAL (CAAR V) 'PLUS))
			  (LISTP (CADR V))
			  (EQUAL (CAADR V) 'PLUS)
			  (MEMBER (CAR V)
				  (PLUS-FRINGE (CADR V)))
			  (LESSP (MEANING (CAR V) A)
				 (MEANING (CADR V) A)))
		     (NOT (MEANING (CONS Z V) A))).

      However this simplifies further, unfolding FORMP, LENGTH, and
      EQUAL, to:

            T.

    Case 10.3.4.
            (IMPLIES (AND (NOT (LISTP D))
			  (NOT (LISTP W))
			  (FORMP (CONS Z (CONS W D)))
			  (EQUAL Z 'EQUAL)
			  (NOT (EQUAL (CAR W) 'PLUS))
			  (LISTP (CAR D))
			  (EQUAL (CAAR D) 'PLUS)
			  (MEMBER W (PLUS-FRINGE (CAR D)))
			  (LESSP (MEANING W A)
				 (MEANING (CAR D) A)))
		     (NOT (MEANING (CONS Z (CONS W D)) A))).

      But this further simplifies, rewriting with CDR-CONS, and
      expanding FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 10.3.3.
            (IMPLIES
		  (AND (NOT (LISTP W))
		       (FORMP (CONS Z
				    (CONS W (CONS (CONS D X1) C))))
		       (EQUAL Z 'EQUAL)
		       (NOT (EQUAL (CAR W) 'PLUS))
		       (EQUAL D 'PLUS)
		       (MEMBER W (PLUS-FRINGE (CONS D X1)))
		       (LESSP (MEANING W A)
			      (MEANING (CONS D X1) A)))
		  (NOT (MEANING (CONS Z (CONS W (CONS (CONS D X1) C)))
				A))),

      which we further simplify, rewriting with the lemmas CDR-CONS,
      ADD1-EQUAL, CAR-CONS, and CAR-NLISTP, and expanding the
      definitions of FORMP, LENGTH, NUMBERP, FORM-LSTP, EQUAL, and
      MEANING, to:

            (IMPLIES (AND (NOT (LISTP W))
			  (EQUAL 0 (LENGTH C))
			  (FORMP W)
			  (EQUAL 2 (LENGTH X1))
			  (FORM-LSTP X1)
			  (FORM-LSTP C)
			  (MEMBER W
				  (PLUS-FRINGE (CONS 'PLUS X1)))
			  (LESSP (MEANING W A)
				 (PLUS (MEANING (CAR X1) A)
				       (MEANING (CADR X1) A))))
		     (NOT (EQUAL (MEANING W A)
				 (PLUS (MEANING (CAR X1) A)
				       (MEANING (CADR X1) A))))),

      which we finally simplify, using linear arithmetic, to:

            T.

    Case 10.3.2.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z (CONS (CONS V C) D)))
			  (EQUAL Z 'EQUAL)
			  (NOT (EQUAL V 'PLUS))
			  (LISTP (CAR D))
			  (EQUAL (CAAR D) 'PLUS)
			  (MEMBER (CONS V C)
				  (PLUS-FRINGE (CAR D)))
			  (LESSP (MEANING (CONS V C) A)
				 (MEANING (CAR D) A)))
		     (NOT (MEANING (CONS Z (CONS (CONS V C) D))
				   A))),

      which we further simplify, rewriting with CDR-CONS, and
      expanding the definitions of FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 10.3.1.
            (IMPLIES (AND (FORMP (CONS Z
				       (CONS (CONS V C)
					     (CONS (CONS D Z1) X1))))
			  (EQUAL Z 'EQUAL)
			  (NOT (EQUAL V 'PLUS))
			  (EQUAL D 'PLUS)
			  (MEMBER (CONS V C)
				  (PLUS-FRINGE (CONS D Z1)))
			  (LESSP (MEANING (CONS V C) A)
				 (MEANING (CONS D Z1) A)))
		     (NOT (MEANING (CONS Z
					 (CONS (CONS V C)
					       (CONS (CONS D Z1) X1)))
				   A))),

      which we further simplify, applying CDR-CONS, ADD1-EQUAL, and
      CAR-CONS, and opening up FORMP, LENGTH, NUMBERP, FORM-LSTP, and
      MEANING, to:

            (IMPLIES (AND (EQUAL 0 (LENGTH X1))
			  (FORMP (CONS V C))
			  (EQUAL 2 (LENGTH Z1))
			  (FORM-LSTP Z1)
			  (FORM-LSTP X1)
			  (NOT (EQUAL V 'PLUS))
			  (MEMBER (CONS V C)
				  (PLUS-FRINGE (CONS 'PLUS Z1)))
			  (LESSP (MEANING (CONS V C) A)
				 (PLUS (MEANING (CAR Z1) A)
				       (MEANING (CADR Z1) A))))
		     (NOT (EQUAL (MEANING (CONS V C) A)
				 (PLUS (MEANING (CAR Z1) A)
				       (MEANING (CADR Z1) A))))),

      which we finally simplify, using linear arithmetic, to:

            T.

  Case 10.2.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(NOT (EQUAL (CAADR X) 'PLUS))
			(LISTP (CADDR X))
			(EQUAL (CAADDR X) 'PLUS)
			(MEMBER (CADR X)
				(PLUS-FRINGE (CADDR X)))
			(NOT (NUMBERP (MEANING (CADR X) A))))
		   (EQUAL (MEANING X A) F)).

    This simplifies again, clearly, to:

          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(NOT (EQUAL (CAADR X) 'PLUS))
			(LISTP (CADDR X))
			(EQUAL (CAADDR X) 'PLUS)
			(MEMBER (CADR X)
				(PLUS-FRINGE (CADDR X)))
			(NOT (NUMBERP (MEANING (CADR X) A))))
		   (NOT (MEANING X A))).

    Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V)
    to eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate
    (CAR V) and (CDR V), W by (CONS V C) to eliminate (CAR W) and
    (CDR W), D by (CONS W X1) to eliminate (CAR D) and (CDR D), W by
    (CONS D Z1) to eliminate (CAR W) and (CDR W), D by (CONS V C) to
    eliminate (CAR D) and (CDR D), and V by (CONS D X1) to eliminate
    (CAR V) and (CDR V).  We must thus prove five new conjectures:

    Case 10.2.5.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'EQUAL)
			  (NOT (EQUAL (CAAR V) 'PLUS))
			  (LISTP (CADR V))
			  (EQUAL (CAADR V) 'PLUS)
			  (MEMBER (CAR V)
				  (PLUS-FRINGE (CADR V)))
			  (NOT (NUMBERP (MEANING (CAR V) A))))
		     (NOT (MEANING (CONS Z V) A))).

      However this further simplifies, expanding the functions FORMP,
      LENGTH, and EQUAL, to:

            T.

    Case 10.2.4.
            (IMPLIES (AND (NOT (LISTP D))
			  (NOT (LISTP W))
			  (FORMP (CONS Z (CONS W D)))
			  (EQUAL Z 'EQUAL)
			  (NOT (EQUAL (CAR W) 'PLUS))
			  (LISTP (CAR D))
			  (EQUAL (CAAR D) 'PLUS)
			  (MEMBER W (PLUS-FRINGE (CAR D)))
			  (NOT (NUMBERP (MEANING W A))))
		     (NOT (MEANING (CONS Z (CONS W D)) A))),

      which further simplifies, rewriting with the lemma CDR-CONS,
      and expanding the functions FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 10.2.3.
            (IMPLIES
		  (AND (NOT (LISTP W))
		       (FORMP (CONS Z
				    (CONS W (CONS (CONS D X1) C))))
		       (EQUAL Z 'EQUAL)
		       (NOT (EQUAL (CAR W) 'PLUS))
		       (EQUAL D 'PLUS)
		       (MEMBER W (PLUS-FRINGE (CONS D X1)))
		       (NOT (NUMBERP (MEANING W A))))
		  (NOT (MEANING (CONS Z (CONS W (CONS (CONS D X1) C)))
				A))).

      This simplifies further, applying CDR-CONS, ADD1-EQUAL,
      CAR-CONS, and CAR-NLISTP, and expanding the functions FORMP,
      LENGTH, NUMBERP, FORM-LSTP, EQUAL, and MEANING, to:

            T.

    Case 10.2.2.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z (CONS (CONS V C) D)))
			  (EQUAL Z 'EQUAL)
			  (NOT (EQUAL V 'PLUS))
			  (LISTP (CAR D))
			  (EQUAL (CAAR D) 'PLUS)
			  (MEMBER (CONS V C)
				  (PLUS-FRINGE (CAR D)))
			  (NOT (NUMBERP (MEANING (CONS V C) A))))
		     (NOT (MEANING (CONS Z (CONS (CONS V C) D))
				   A))),

      which we further simplify, applying the lemma CDR-CONS, and
      opening up the definitions of FORMP, LENGTH, ADD1, and EQUAL,
      to:

            T.

    Case 10.2.1.
            (IMPLIES (AND (FORMP (CONS Z
				       (CONS (CONS V C)
					     (CONS (CONS D Z1) X1))))
			  (EQUAL Z 'EQUAL)
			  (NOT (EQUAL V 'PLUS))
			  (EQUAL D 'PLUS)
			  (MEMBER (CONS V C)
				  (PLUS-FRINGE (CONS D Z1)))
			  (NOT (NUMBERP (MEANING (CONS V C) A))))
		     (NOT (MEANING (CONS Z
					 (CONS (CONS V C)
					       (CONS (CONS D Z1) X1)))
				   A))),

      which we further simplify, appealing to the lemmas CDR-CONS,
      ADD1-EQUAL, and CAR-CONS, and unfolding the functions FORMP,
      LENGTH, NUMBERP, FORM-LSTP, and MEANING, to:

            T.

  Case 10.1.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(NOT (EQUAL (CAADR X) 'PLUS))
			(LISTP (CADDR X))
			(EQUAL (CAADDR X) 'PLUS)
			(MEMBER (CADR X)
				(PLUS-FRINGE (CADDR X)))
			(NUMBERP (MEANING (CADR X) A))
			( LEQ
			  (MEANING (CADDR X) A)
			  (MEANING (CADR X) A)))
		   (EQUAL (MEANING X A) T)).

    Appealing to the lemma CAR-CDR-ELIM, we now replace X by
    (CONS Z V) to eliminate (CAR X) and (CDR X), V by (CONS W D) to
    eliminate (CAR V) and (CDR V), W by (CONS V C) to eliminate
    (CAR W) and (CDR W), D by (CONS W X1) to eliminate (CAR D) and
    (CDR D), W by (CONS D Z1) to eliminate (CAR W) and (CDR W), D by
    (CONS V C) to eliminate (CAR D) and (CDR D), and V by (CONS D X1)
    to eliminate (CAR V) and (CDR V).  The result is five new
    formulas:

    Case 10.1.5.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'EQUAL)
			  (NOT (EQUAL (CAAR V) 'PLUS))
			  (LISTP (CADR V))
			  (EQUAL (CAADR V) 'PLUS)
			  (MEMBER (CAR V)
				  (PLUS-FRINGE (CADR V)))
			  (NUMBERP (MEANING (CAR V) A))
			  ( LEQ
			    (MEANING (CADR V) A)
			    (MEANING (CAR V) A)))
		     (EQUAL (MEANING (CONS Z V) A) T)).

      This further simplifies, expanding the definitions of FORMP,
      LENGTH, and EQUAL, to:

            T.

    Case 10.1.4.
            (IMPLIES (AND (NOT (LISTP D))
			  (NOT (LISTP W))
			  (FORMP (CONS Z (CONS W D)))
			  (EQUAL Z 'EQUAL)
			  (NOT (EQUAL (CAR W) 'PLUS))
			  (LISTP (CAR D))
			  (EQUAL (CAAR D) 'PLUS)
			  (MEMBER W (PLUS-FRINGE (CAR D)))
			  (NUMBERP (MEANING W A))
			  ( LEQ
			    (MEANING (CAR D) A)
			    (MEANING W A)))
		     (EQUAL (MEANING (CONS Z (CONS W D)) A)
			    T)),

      which further simplifies, applying CDR-CONS, and opening up the
      definitions of FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 10.1.3.
            (IMPLIES
		(AND (NOT (LISTP W))
		     (FORMP (CONS Z
				  (CONS W (CONS (CONS D X1) C))))
		     (EQUAL Z 'EQUAL)
		     (NOT (EQUAL (CAR W) 'PLUS))
		     (EQUAL D 'PLUS)
		     (MEMBER W (PLUS-FRINGE (CONS D X1)))
		     (NUMBERP (MEANING W A))
		     ( LEQ
		       (MEANING (CONS D X1) A)
		       (MEANING W A)))
		(EQUAL (MEANING (CONS Z (CONS W (CONS (CONS D X1) C)))
				A)
		       T)),

      which we further simplify, applying CDR-CONS, ADD1-EQUAL,
      CAR-CONS, and CAR-NLISTP, and expanding the functions FORMP,
      LENGTH, NUMBERP, FORM-LSTP, EQUAL, and MEANING, to the formula:

            (IMPLIES (AND (NOT (LISTP W))
			  (EQUAL 0 (LENGTH C))
			  (FORMP W)
			  (EQUAL 2 (LENGTH X1))
			  (FORM-LSTP X1)
			  (FORM-LSTP C)
			  (MEMBER W
				  (PLUS-FRINGE (CONS 'PLUS X1)))
			  (NUMBERP (MEANING W A))
			  ( LEQ
			    (PLUS (MEANING (CAR X1) A)
				  (MEANING (CADR X1) A))
			    (MEANING W A)))
		     (EQUAL (MEANING W A)
			    (PLUS (MEANING (CAR X1) A)
				  (MEANING (CADR X1) A)))).

      This simplifies again, using linear arithmetic, rewriting with
      MEMBER-IMPLIES-PLUS-TREE-GREATEREQP and PLUS-TREE-PLUS-FRINGE,
      and expanding the function MEANING, to:

            T.

    Case 10.1.2.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z (CONS (CONS V C) D)))
			  (EQUAL Z 'EQUAL)
			  (NOT (EQUAL V 'PLUS))
			  (LISTP (CAR D))
			  (EQUAL (CAAR D) 'PLUS)
			  (MEMBER (CONS V C)
				  (PLUS-FRINGE (CAR D)))
			  (NUMBERP (MEANING (CONS V C) A))
			  ( LEQ
			    (MEANING (CAR D) A)
			    (MEANING (CONS V C) A)))
		     (EQUAL (MEANING (CONS Z (CONS (CONS V C) D))
				     A)
			    T)).

      However this simplifies further, using linear arithmetic and
      rewriting with the lemmas MEMBER-IMPLIES-PLUS-TREE-GREATEREQP,
      PLUS-TREE-PLUS-FRINGE, and MEMBER-IMPLIES-NUMBERP, to two new
      conjectures:

      Case 10.1.2.2.
              (IMPLIES
		    (AND (NOT (NUMBERP (MEANING (CAR D) A)))
			 (NOT (LISTP D))
			 (FORMP (CONS 'EQUAL (CONS (CONS V C) D)))
			 (NOT (EQUAL V 'PLUS))
			 (LISTP (CAR D))
			 (EQUAL (CAAR D) 'PLUS)
			 (MEMBER (CONS V C)
				 (PLUS-FRINGE (CAR D)))
			 (NUMBERP (MEANING (CONS V C) A))
			 ( LEQ
			   (MEANING (CAR D) A)
			   (MEANING (CONS V C) A)))
		    (EQUAL (MEANING (CONS 'EQUAL (CONS (CONS V C) D))
				    A)
			   T)).

        However this again simplifies, appealing to the lemmas
        CAR-NLISTP and CDR-CONS, and opening up MEANING, FORMP,
        LENGTH, ADD1, and EQUAL, to:

              T.

      Case 10.1.2.1.
              (IMPLIES
		    (AND (NUMBERP (MEANING (CAR D) A))
			 (EQUAL (MEANING (CONS V C) A)
				(MEANING (CAR D) A))
			 (NOT (LISTP D))
			 (FORMP (CONS 'EQUAL (CONS (CONS V C) D)))
			 (NOT (EQUAL V 'PLUS))
			 (LISTP (CAR D))
			 (EQUAL (CAAR D) 'PLUS)
			 (MEMBER (CONS V C)
				 (PLUS-FRINGE (CAR D)))
			 ( LEQ
			   (MEANING (CAR D) A)
			   (MEANING (CAR D) A)))
		    (EQUAL (MEANING (CONS 'EQUAL (CONS (CONS V C) D))
				    A)
			   T)).

        However this again simplifies, applying the lemmas CAR-NLISTP
        and CDR-CONS, and unfolding the definitions of MEANING, FORMP,
        LENGTH, ADD1, and EQUAL, to:

              T.

    Case 10.1.1.
            (IMPLIES
		   (AND (FORMP (CONS Z
				     (CONS (CONS V C)
					   (CONS (CONS D Z1) X1))))
			(EQUAL Z 'EQUAL)
			(NOT (EQUAL V 'PLUS))
			(EQUAL D 'PLUS)
			(MEMBER (CONS V C)
				(PLUS-FRINGE (CONS D Z1)))
			(NUMBERP (MEANING (CONS V C) A))
			( LEQ
			  (MEANING (CONS D Z1) A)
			  (MEANING (CONS V C) A)))
		   (EQUAL (MEANING (CONS Z
					 (CONS (CONS V C)
					       (CONS (CONS D Z1) X1)))
				   A)
			  T)).

      But this simplifies further, rewriting with CDR-CONS,
      ADD1-EQUAL, and CAR-CONS, and unfolding the definitions of
      FORMP, LENGTH, NUMBERP, FORM-LSTP, and MEANING, to:

            (IMPLIES (AND (EQUAL 0 (LENGTH X1))
			  (FORMP (CONS V C))
			  (EQUAL 2 (LENGTH Z1))
			  (FORM-LSTP Z1)
			  (FORM-LSTP X1)
			  (NOT (EQUAL V 'PLUS))
			  (MEMBER (CONS V C)
				  (PLUS-FRINGE (CONS 'PLUS Z1)))
			  (NUMBERP (MEANING (CONS V C) A))
			  ( LEQ
			    (PLUS (MEANING (CAR Z1) A)
				  (MEANING (CADR Z1) A))
			    (MEANING (CONS V C) A)))
		     (EQUAL (MEANING (CONS V C) A)
			    (PLUS (MEANING (CAR Z1) A)
				  (MEANING (CADR Z1) A)))).

      However this again simplifies, using linear arithmetic,
      rewriting with MEMBER-IMPLIES-PLUS-TREE-GREATEREQP and
      PLUS-TREE-PLUS-FRINGE, and opening up the definition of MEANING,
      to:

            T.

Case 9. (IMPLIES
	 (AND (FORMP X)
	      (LISTP X)
	      (EQUAL (CAR X) 'EQUAL)
	      (NOT (LISTP (CADR X)))
	      (LISTP (CADDR X))
	      (EQUAL (CAADDR X) 'PLUS)
	      (MEMBER (CADR X)
		      (PLUS-FRINGE (CADDR X))))
	 (EQUAL
	  (MEANING X A)
	  (MEANING
	   (CONS 'IF
	    (CONS
	     (LIST 'NUMBERP (CADR X))
	     (CONS (LIST 'EQUAL
			 ''0
			 (PLUS-TREE (DELETE (CADR X)
					    (PLUS-FRINGE (CADDR X)))))
		   '('1FALSE))))
	   A))).

  This again simplifies, applying CAR-CONS, CDR-CONS,
  MEMBER-IMPLIES-NUMBERP, PLUS-TREE-PLUS-FRINGE, PLUS-TREE-DELETE,
  and EQUAL-DIFFERENCE-0, and unfolding the definitions of MEANING
  and CAR, to the following three new goals:

  Case 9.3.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(NOT (LISTP (CADR X)))
			(LISTP (CADDR X))
			(EQUAL (CAADDR X) 'PLUS)
			(MEMBER (CADR X)
				(PLUS-FRINGE (CADDR X)))
			(LESSP (MEANING (CADR X) A)
			       (MEANING (CADDR X) A)))
		   (EQUAL (MEANING X A) F)).

    Of course, this again simplifies, obviously, to:

          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(NOT (LISTP (CADR X)))
			(LISTP (CADDR X))
			(EQUAL (CAADDR X) 'PLUS)
			(MEMBER (CADR X)
				(PLUS-FRINGE (CADDR X)))
			(LESSP (MEANING (CADR X) A)
			       (MEANING (CADDR X) A)))
		   (NOT (MEANING X A))).

    Appealing to the lemma CAR-CDR-ELIM, we now replace X by
    (CONS Z V) to eliminate (CAR X) and (CDR X), V by (CONS W D) to
    eliminate (CAR V) and (CDR V), D by (CONS V C) to eliminate
    (CAR D) and (CDR D), and V by (CONS D X1) to eliminate (CAR V)
    and (CDR V).  The result is three new conjectures:

    Case 9.3.3.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'EQUAL)
			  (NOT (LISTP (CAR V)))
			  (LISTP (CADR V))
			  (EQUAL (CAADR V) 'PLUS)
			  (MEMBER (CAR V)
				  (PLUS-FRINGE (CADR V)))
			  (LESSP (MEANING (CAR V) A)
				 (MEANING (CADR V) A)))
		     (NOT (MEANING (CONS Z V) A))).

      But this further simplifies, opening up FORMP, LENGTH, and
      EQUAL, to:

            T.

    Case 9.3.2.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z (CONS W D)))
			  (EQUAL Z 'EQUAL)
			  (NOT (LISTP W))
			  (LISTP (CAR D))
			  (EQUAL (CAAR D) 'PLUS)
			  (MEMBER W (PLUS-FRINGE (CAR D)))
			  (LESSP (MEANING W A)
				 (MEANING (CAR D) A)))
		     (NOT (MEANING (CONS Z (CONS W D)) A))).

      But this simplifies further, rewriting with the lemma CDR-CONS,
      and expanding FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 9.3.1.
            (IMPLIES
		  (AND (FORMP (CONS Z
				    (CONS W (CONS (CONS D X1) C))))
		       (EQUAL Z 'EQUAL)
		       (NOT (LISTP W))
		       (EQUAL D 'PLUS)
		       (MEMBER W (PLUS-FRINGE (CONS D X1)))
		       (LESSP (MEANING W A)
			      (MEANING (CONS D X1) A)))
		  (NOT (MEANING (CONS Z (CONS W (CONS (CONS D X1) C)))
				A))).

      This further simplifies, rewriting with CDR-CONS, ADD1-EQUAL,
      and CAR-CONS, and opening up the functions FORMP, LENGTH,
      NUMBERP, FORM-LSTP, and MEANING, to:

            (IMPLIES (AND (EQUAL 0 (LENGTH C))
			  (FORMP W)
			  (EQUAL 2 (LENGTH X1))
			  (FORM-LSTP X1)
			  (FORM-LSTP C)
			  (NOT (LISTP W))
			  (MEMBER W
				  (PLUS-FRINGE (CONS 'PLUS X1)))
			  (LESSP (MEANING W A)
				 (PLUS (MEANING (CAR X1) A)
				       (MEANING (CADR X1) A))))
		     (NOT (EQUAL (MEANING W A)
				 (PLUS (MEANING (CAR X1) A)
				       (MEANING (CADR X1) A))))).

      This simplifies finally, using linear arithmetic, to:

            T.

  Case 9.2.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(NOT (LISTP (CADR X)))
			(LISTP (CADDR X))
			(EQUAL (CAADDR X) 'PLUS)
			(MEMBER (CADR X)
				(PLUS-FRINGE (CADDR X)))
			(NOT (NUMBERP (MEANING (CADR X) A))))
		   (EQUAL (MEANING X A) F)).

    Of course, this again simplifies, clearly, to the formula:

          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(NOT (LISTP (CADR X)))
			(LISTP (CADDR X))
			(EQUAL (CAADDR X) 'PLUS)
			(MEMBER (CADR X)
				(PLUS-FRINGE (CADDR X)))
			(NOT (NUMBERP (MEANING (CADR X) A))))
		   (NOT (MEANING X A))).

    Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
    eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate
    (CAR V) and (CDR V), D by (CONS V C) to eliminate (CAR D) and
    (CDR D), and V by (CONS D X1) to eliminate (CAR V) and (CDR V).
    This produces three new formulas:

    Case 9.2.3.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'EQUAL)
			  (NOT (LISTP (CAR V)))
			  (LISTP (CADR V))
			  (EQUAL (CAADR V) 'PLUS)
			  (MEMBER (CAR V)
				  (PLUS-FRINGE (CADR V)))
			  (NOT (NUMBERP (MEANING (CAR V) A))))
		     (NOT (MEANING (CONS Z V) A))),

      which we further simplify, expanding FORMP, LENGTH, and EQUAL,
      to:

            T.

    Case 9.2.2.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z (CONS W D)))
			  (EQUAL Z 'EQUAL)
			  (NOT (LISTP W))
			  (LISTP (CAR D))
			  (EQUAL (CAAR D) 'PLUS)
			  (MEMBER W (PLUS-FRINGE (CAR D)))
			  (NOT (NUMBERP (MEANING W A))))
		     (NOT (MEANING (CONS Z (CONS W D)) A))),

      which further simplifies, applying CDR-CONS, and opening up the
      functions FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 9.2.1.
            (IMPLIES
		  (AND (FORMP (CONS Z
				    (CONS W (CONS (CONS D X1) C))))
		       (EQUAL Z 'EQUAL)
		       (NOT (LISTP W))
		       (EQUAL D 'PLUS)
		       (MEMBER W (PLUS-FRINGE (CONS D X1)))
		       (NOT (NUMBERP (MEANING W A))))
		  (NOT (MEANING (CONS Z (CONS W (CONS (CONS D X1) C)))
				A))).

      However this simplifies further, applying the lemmas CDR-CONS,
      ADD1-EQUAL, and CAR-CONS, and expanding FORMP, LENGTH, NUMBERP,
      FORM-LSTP, and MEANING, to:

            T.

  Case 9.1.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(NOT (LISTP (CADR X)))
			(LISTP (CADDR X))
			(EQUAL (CAADDR X) 'PLUS)
			(MEMBER (CADR X)
				(PLUS-FRINGE (CADDR X)))
			(NUMBERP (MEANING (CADR X) A))
			( LEQ
			  (MEANING (CADDR X) A)
			  (MEANING (CADR X) A)))
		   (EQUAL (MEANING X A) T)).

    Appealing to the lemma CAR-CDR-ELIM, we now replace X by
    (CONS Z V) to eliminate (CAR X) and (CDR X), V by (CONS W D) to
    eliminate (CAR V) and (CDR V), D by (CONS V C) to eliminate
    (CAR D) and (CDR D), and V by (CONS D X1) to eliminate (CAR V)
    and (CDR V).  We would thus like to prove the following three new
    conjectures:

    Case 9.1.3.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'EQUAL)
			  (NOT (LISTP (CAR V)))
			  (LISTP (CADR V))
			  (EQUAL (CAADR V) 'PLUS)
			  (MEMBER (CAR V)
				  (PLUS-FRINGE (CADR V)))
			  (NUMBERP (MEANING (CAR V) A))
			  ( LEQ
			    (MEANING (CADR V) A)
			    (MEANING (CAR V) A)))
		     (EQUAL (MEANING (CONS Z V) A) T)),

      which further simplifies, expanding the functions FORMP, LENGTH,
      and EQUAL, to:

            T.

    Case 9.1.2.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z (CONS W D)))
			  (EQUAL Z 'EQUAL)
			  (NOT (LISTP W))
			  (LISTP (CAR D))
			  (EQUAL (CAAR D) 'PLUS)
			  (MEMBER W (PLUS-FRINGE (CAR D)))
			  (NUMBERP (MEANING W A))
			  ( LEQ
			    (MEANING (CAR D) A)
			    (MEANING W A)))
		     (EQUAL (MEANING (CONS Z (CONS W D)) A)
			    T)),

      which we further simplify, applying CDR-CONS, and expanding the
      functions FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 9.1.1.
            (IMPLIES
		(AND (FORMP (CONS Z
				  (CONS W (CONS (CONS D X1) C))))
		     (EQUAL Z 'EQUAL)
		     (NOT (LISTP W))
		     (EQUAL D 'PLUS)
		     (MEMBER W (PLUS-FRINGE (CONS D X1)))
		     (NUMBERP (MEANING W A))
		     ( LEQ
		       (MEANING (CONS D X1) A)
		       (MEANING W A)))
		(EQUAL (MEANING (CONS Z (CONS W (CONS (CONS D X1) C)))
				A)
		       T)).

      However this simplifies further, applying CDR-CONS, ADD1-EQUAL,
      and CAR-CONS, and unfolding FORMP, LENGTH, NUMBERP, FORM-LSTP,
      and MEANING, to:

            (IMPLIES (AND (EQUAL 0 (LENGTH C))
			  (FORMP W)
			  (EQUAL 2 (LENGTH X1))
			  (FORM-LSTP X1)
			  (FORM-LSTP C)
			  (NOT (LISTP W))
			  (MEMBER W
				  (PLUS-FRINGE (CONS 'PLUS X1)))
			  (NUMBERP (MEANING W A))
			  ( LEQ
			    (PLUS (MEANING (CAR X1) A)
				  (MEANING (CADR X1) A))
			    (MEANING W A)))
		     (EQUAL (MEANING W A)
			    (PLUS (MEANING (CAR X1) A)
				  (MEANING (CADR X1) A)))).

      However this simplifies again, using linear arithmetic,
      applying the lemmas MEMBER-IMPLIES-PLUS-TREE-GREATEREQP and
      PLUS-TREE-PLUS-FRINGE, and opening up the function MEANING, to:

            T.

Case 8. (IMPLIES
	 (AND (FORMP X)
	      (LISTP X)
	      (EQUAL (CAR X) 'EQUAL)
	      (LISTP (CADR X))
	      (EQUAL (CAADR X) 'PLUS)
	      (NOT (EQUAL (CAADDR X) 'PLUS))
	      (MEMBER (CADDR X)
		      (PLUS-FRINGE (CADR X))))
	 (EQUAL
	  (MEANING X A)
	  (MEANING
	   (CONS 'IF
	    (CONS
	     (LIST 'NUMBERP (CADDR X))
	     (CONS
	       (CONS 'EQUAL
		     (CONS (PLUS-TREE (DELETE (CADDR X)
					      (PLUS-FRINGE (CADR X))))
			   '('0)))
	       '('1FALSE))))
	   A))),

  which again simplifies, rewriting with CAR-CONS, CDR-CONS,
  MEMBER-IMPLIES-NUMBERP, PLUS-TREE-PLUS-FRINGE, PLUS-TREE-DELETE,
  and EQUAL-DIFFERENCE-0, and opening up the functions MEANING and
  CAR, to the following three new formulas:

  Case 8.3.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'PLUS)
			(NOT (EQUAL (CAADDR X) 'PLUS))
			(MEMBER (CADDR X)
				(PLUS-FRINGE (CADR X)))
			(LESSP (MEANING (CADDR X) A)
			       (MEANING (CADR X) A)))
		   (EQUAL (MEANING X A) F)).

    Of course, this again simplifies, clearly, to:

          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'PLUS)
			(NOT (EQUAL (CAADDR X) 'PLUS))
			(MEMBER (CADDR X)
				(PLUS-FRINGE (CADR X)))
			(LESSP (MEANING (CADDR X) A)
			       (MEANING (CADR X) A)))
		   (NOT (MEANING X A))).

    Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
    eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate
    (CAR V) and (CDR V), W by (CONS V C) to eliminate (CAR W) and
    (CDR W), D by (CONS W X1) to eliminate (CAR D) and (CDR D), and W
    by (CONS D Z1) to eliminate (CAR W) and (CDR W).  This generates
    the following four new goals:

    Case 8.3.4.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'EQUAL)
			  (LISTP (CAR V))
			  (EQUAL (CAAR V) 'PLUS)
			  (NOT (EQUAL (CAADR V) 'PLUS))
			  (MEMBER (CADR V)
				  (PLUS-FRINGE (CAR V)))
			  (LESSP (MEANING (CADR V) A)
				 (MEANING (CAR V) A)))
		     (NOT (MEANING (CONS Z V) A))).

      However this simplifies further, expanding the functions FORMP,
      LENGTH, and EQUAL, to:

            T.

    Case 8.3.3.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z (CONS (CONS V C) D)))
			  (EQUAL Z 'EQUAL)
			  (EQUAL V 'PLUS)
			  (NOT (EQUAL (CAAR D) 'PLUS))
			  (MEMBER (CAR D)
				  (PLUS-FRINGE (CONS V C)))
			  (LESSP (MEANING (CAR D) A)
				 (MEANING (CONS V C) A)))
		     (NOT (MEANING (CONS Z (CONS (CONS V C) D))
				   A))).

      However this simplifies further, rewriting with CDR-CONS, and
      unfolding FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 8.3.2.
            (IMPLIES
		  (AND (NOT (LISTP W))
		       (FORMP (CONS Z
				    (CONS (CONS V C) (CONS W X1))))
		       (EQUAL Z 'EQUAL)
		       (EQUAL V 'PLUS)
		       (NOT (EQUAL (CAR W) 'PLUS))
		       (MEMBER W (PLUS-FRINGE (CONS V C)))
		       (LESSP (MEANING W A)
			      (MEANING (CONS V C) A)))
		  (NOT (MEANING (CONS Z (CONS (CONS V C) (CONS W X1)))
				A))).

      This further simplifies, rewriting with the lemmas CDR-CONS,
      ADD1-EQUAL, CAR-CONS, and CAR-NLISTP, and unfolding the
      definitions of FORMP, LENGTH, NUMBERP, FORM-LSTP, EQUAL, and
      MEANING, to:

            (IMPLIES (AND (NOT (LISTP W))
			  (EQUAL 0 (LENGTH X1))
			  (EQUAL 2 (LENGTH C))
			  (FORM-LSTP C)
			  (FORMP W)
			  (FORM-LSTP X1)
			  (MEMBER W
				  (PLUS-FRINGE (CONS 'PLUS C)))
			  (LESSP (MEANING W A)
				 (PLUS (MEANING (CAR C) A)
				       (MEANING (CADR C) A))))
		     (NOT (EQUAL (PLUS (MEANING (CAR C) A)
				       (MEANING (CADR C) A))
				 (MEANING W A)))).

      This finally simplifies, using linear arithmetic, to:

            T.

    Case 8.3.1.
            (IMPLIES (AND (FORMP (CONS Z
				       (CONS (CONS V C)
					     (CONS (CONS D Z1) X1))))
			  (EQUAL Z 'EQUAL)
			  (EQUAL V 'PLUS)
			  (NOT (EQUAL D 'PLUS))
			  (MEMBER (CONS D Z1)
				  (PLUS-FRINGE (CONS V C)))
			  (LESSP (MEANING (CONS D Z1) A)
				 (MEANING (CONS V C) A)))
		     (NOT (MEANING (CONS Z
					 (CONS (CONS V C)
					       (CONS (CONS D Z1) X1)))
				   A))),

      which we further simplify, applying CDR-CONS, ADD1-EQUAL, and
      CAR-CONS, and expanding FORMP, LENGTH, NUMBERP, FORM-LSTP, and
      MEANING, to the goal:

            (IMPLIES (AND (EQUAL 0 (LENGTH X1))
			  (EQUAL 2 (LENGTH C))
			  (FORM-LSTP C)
			  (FORMP (CONS D Z1))
			  (FORM-LSTP X1)
			  (NOT (EQUAL D 'PLUS))
			  (MEMBER (CONS D Z1)
				  (PLUS-FRINGE (CONS 'PLUS C)))
			  (LESSP (MEANING (CONS D Z1) A)
				 (PLUS (MEANING (CAR C) A)
				       (MEANING (CADR C) A))))
		     (NOT (EQUAL (PLUS (MEANING (CAR C) A)
				       (MEANING (CADR C) A))
				 (MEANING (CONS D Z1) A)))).

      But this simplifies finally, using linear arithmetic, to:

            T.

  Case 8.2.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'PLUS)
			(NOT (EQUAL (CAADDR X) 'PLUS))
			(MEMBER (CADDR X)
				(PLUS-FRINGE (CADR X)))
			(NOT (NUMBERP (MEANING (CADDR X) A))))
		   (EQUAL (MEANING X A) F)).

    This simplifies again, trivially, to:

          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'PLUS)
			(NOT (EQUAL (CAADDR X) 'PLUS))
			(MEMBER (CADDR X)
				(PLUS-FRINGE (CADR X)))
			(NOT (NUMBERP (MEANING (CADDR X) A))))
		   (NOT (MEANING X A))).

    Appealing to the lemma CAR-CDR-ELIM, we now replace X by
    (CONS Z V) to eliminate (CAR X) and (CDR X), V by (CONS W D) to
    eliminate (CAR V) and (CDR V), W by (CONS V C) to eliminate
    (CAR W) and (CDR W), D by (CONS W X1) to eliminate (CAR D) and
    (CDR D), and W by (CONS D Z1) to eliminate (CAR W) and (CDR W).
    We must thus prove four new formulas:

    Case 8.2.4.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'EQUAL)
			  (LISTP (CAR V))
			  (EQUAL (CAAR V) 'PLUS)
			  (NOT (EQUAL (CAADR V) 'PLUS))
			  (MEMBER (CADR V)
				  (PLUS-FRINGE (CAR V)))
			  (NOT (NUMBERP (MEANING (CADR V) A))))
		     (NOT (MEANING (CONS Z V) A))),

      which further simplifies, expanding the functions FORMP, LENGTH,
      and EQUAL, to:

            T.

    Case 8.2.3.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z (CONS (CONS V C) D)))
			  (EQUAL Z 'EQUAL)
			  (EQUAL V 'PLUS)
			  (NOT (EQUAL (CAAR D) 'PLUS))
			  (MEMBER (CAR D)
				  (PLUS-FRINGE (CONS V C)))
			  (NOT (NUMBERP (MEANING (CAR D) A))))
		     (NOT (MEANING (CONS Z (CONS (CONS V C) D))
				   A))),

      which further simplifies, applying CDR-CONS, and opening up the
      functions FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 8.2.2.
            (IMPLIES
		  (AND (NOT (LISTP W))
		       (FORMP (CONS Z
				    (CONS (CONS V C) (CONS W X1))))
		       (EQUAL Z 'EQUAL)
		       (EQUAL V 'PLUS)
		       (NOT (EQUAL (CAR W) 'PLUS))
		       (MEMBER W (PLUS-FRINGE (CONS V C)))
		       (NOT (NUMBERP (MEANING W A))))
		  (NOT (MEANING (CONS Z (CONS (CONS V C) (CONS W X1)))
				A))).

      This further simplifies, rewriting with CDR-CONS, ADD1-EQUAL,
      CAR-CONS, and CAR-NLISTP, and opening up the functions FORMP,
      LENGTH, NUMBERP, FORM-LSTP, EQUAL, and MEANING, to:

            T.

    Case 8.2.1.
            (IMPLIES (AND (FORMP (CONS Z
				       (CONS (CONS V C)
					     (CONS (CONS D Z1) X1))))
			  (EQUAL Z 'EQUAL)
			  (EQUAL V 'PLUS)
			  (NOT (EQUAL D 'PLUS))
			  (MEMBER (CONS D Z1)
				  (PLUS-FRINGE (CONS V C)))
			  (NOT (NUMBERP (MEANING (CONS D Z1) A))))
		     (NOT (MEANING (CONS Z
					 (CONS (CONS V C)
					       (CONS (CONS D Z1) X1)))
				   A))),

      which further simplifies, rewriting with the lemmas CDR-CONS,
      ADD1-EQUAL, and CAR-CONS, and opening up FORMP, LENGTH, NUMBERP,
      FORM-LSTP, and MEANING, to:

            T.

  Case 8.1.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'PLUS)
			(NOT (EQUAL (CAADDR X) 'PLUS))
			(MEMBER (CADDR X)
				(PLUS-FRINGE (CADR X)))
			(NUMBERP (MEANING (CADDR X) A))
			( LEQ
			  (MEANING (CADR X) A)
			  (MEANING (CADDR X) A)))
		   (EQUAL (MEANING X A) T)).

    However this again simplifies, using linear arithmetic and
    applying MEMBER-IMPLIES-PLUS-TREE-GREATEREQP,
    PLUS-TREE-PLUS-FRINGE, and MEMBER-IMPLIES-NUMBERP, to the
    following two new goals:

    Case 8.1.2.
            (IMPLIES (AND (NOT (NUMBERP (MEANING (CADR X) A)))
			  (FORMP X)
			  (LISTP X)
			  (EQUAL (CAR X) 'EQUAL)
			  (LISTP (CADR X))
			  (EQUAL (CAADR X) 'PLUS)
			  (NOT (EQUAL (CAADDR X) 'PLUS))
			  (MEMBER (CADDR X)
				  (PLUS-FRINGE (CADR X)))
			  (NUMBERP (MEANING (CADDR X) A))
			  ( LEQ
			    (MEANING (CADR X) A)
			    (MEANING (CADDR X) A)))
		     (EQUAL (MEANING X A) T)),

      which again simplifies, appealing to the lemma
      MEMBER-IMPLIES-NUMBERP, to:

            T.

    Case 8.1.1.
            (IMPLIES (AND (NUMBERP (MEANING (CADR X) A))
			  (EQUAL (MEANING (CADDR X) A)
				 (MEANING (CADR X) A))
			  (FORMP X)
			  (LISTP X)
			  (EQUAL (CAR X) 'EQUAL)
			  (LISTP (CADR X))
			  (EQUAL (CAADR X) 'PLUS)
			  (NOT (EQUAL (CAADDR X) 'PLUS))
			  (MEMBER (CADDR X)
				  (PLUS-FRINGE (CADR X)))
			  ( LEQ
			    (MEANING (CADR X) A)
			    (MEANING (CADR X) A)))
		     (EQUAL (MEANING X A) T)).

      However this simplifies again, rewriting with the lemmas
      NUMBERP-MEANING-PLUS and MEMBER-IMPLIES-NUMBERP, to:

            (IMPLIES (AND (EQUAL (MEANING (CADDR X) A)
				 (MEANING (CADR X) A))
			  (FORMP X)
			  (LISTP X)
			  (EQUAL (CAR X) 'EQUAL)
			  (LISTP (CADR X))
			  (EQUAL (CAADR X) 'PLUS)
			  (NOT (EQUAL (CAADDR X) 'PLUS))
			  (MEMBER (CADDR X)
				  (PLUS-FRINGE (CADR X)))
			  ( LEQ
			    (MEANING (CADR X) A)
			    (MEANING (CADR X) A)))
		     (EQUAL (MEANING X A) T)).

      Applying the lemma CAR-CDR-ELIM, replace X by (CONS V Z) to
      eliminate (CDR X) and (CAR X), Z by (CONS D W) to eliminate
      (CDR Z) and (CAR Z), W by (CONS Z C) to eliminate (CAR W) and
      (CDR W), Z by (CONS W X1) to eliminate (CAR Z) and (CDR Z), D
      by (CONS Z Z1) to eliminate (CAR D) and (CDR D), D by
      (CONS W X1) to eliminate (CAR D) and (CDR D), and D by
      (CONS Z C) to eliminate (CAR D) and (CDR D).  We thus obtain
      the following four new conjectures:

      Case 8.1.1.4.
              (IMPLIES (AND (NOT (LISTP Z))
			    (EQUAL (MEANING (CADR Z) A)
				   (MEANING (CAR Z) A))
			    (FORMP (CONS V Z))
			    (EQUAL V 'EQUAL)
			    (LISTP (CAR Z))
			    (EQUAL (CAAR Z) 'PLUS)
			    (NOT (EQUAL (CAADR Z) 'PLUS))
			    (MEMBER (CADR Z)
				    (PLUS-FRINGE (CAR Z)))
			    ( LEQ
			      (MEANING (CAR Z) A)
			      (MEANING (CAR Z) A)))
		       (EQUAL (MEANING (CONS V Z) A) T)).

        But this finally simplifies, applying CDR-NLISTP and
        CAR-NLISTP, and unfolding CAR, MEANING, FORMP, LENGTH, and
        EQUAL, to:

              T.

      Case 8.1.1.3.
              (IMPLIES (AND (NOT (LISTP W))
			    (EQUAL (MEANING (CAR W) A)
				   (MEANING (CONS Z C) A))
			    (FORMP (CONS V (CONS (CONS Z C) W)))
			    (EQUAL V 'EQUAL)
			    (EQUAL Z 'PLUS)
			    (NOT (EQUAL (CAAR W) 'PLUS))
			    (MEMBER (CAR W)
				    (PLUS-FRINGE (CONS Z C)))
			    ( LEQ
			      (MEANING (CONS Z C) A)
			      (MEANING (CONS Z C) A)))
		       (EQUAL (MEANING (CONS V (CONS (CONS Z C) W))
				       A)
			      T)).

        This simplifies finally, appealing to the lemmas CAR-NLISTP
        and CDR-CONS, and unfolding MEANING, FORMP, LENGTH, ADD1, and
        EQUAL, to:

              T.

      Case 8.1.1.2.
              (IMPLIES
		(AND (NOT (LISTP Z))
		     (EQUAL (MEANING Z A)
			    (MEANING (CONS W X1) A))
		     (FORMP (CONS V
				  (CONS (CONS W X1) (CONS Z C))))
		     (EQUAL V 'EQUAL)
		     (EQUAL W 'PLUS)
		     (NOT (EQUAL (CAR Z) 'PLUS))
		     (MEMBER Z (PLUS-FRINGE (CONS W X1)))
		     ( LEQ
		       (MEANING (CONS W X1) A)
		       (MEANING (CONS W X1) A)))
		(EQUAL (MEANING (CONS V (CONS (CONS W X1) (CONS Z C)))
				A)
		       T)),

        which finally simplifies, rewriting with CDR-CONS, ADD1-EQUAL,
        CAR-CONS, and CAR-NLISTP, and expanding the functions MEANING,
        FORMP, LENGTH, NUMBERP, FORM-LSTP, and EQUAL, to:

              T.

      Case 8.1.1.1.
              (IMPLIES
		    (AND (EQUAL (MEANING (CONS W X1) A)
				(MEANING (CONS Z Z1) A))
			 (FORMP (CONS V
				      (CONS (CONS Z Z1)
					    (CONS (CONS W X1) C))))
			 (EQUAL V 'EQUAL)
			 (EQUAL Z 'PLUS)
			 (NOT (EQUAL W 'PLUS))
			 (MEMBER (CONS W X1)
				 (PLUS-FRINGE (CONS Z Z1)))
			 ( LEQ
			   (MEANING (CONS Z Z1) A)
			   (MEANING (CONS Z Z1) A)))
		    (EQUAL (MEANING (CONS V
					  (CONS (CONS Z Z1)
						(CONS (CONS W X1) C)))
				    A)
			   T)).

        This simplifies finally, rewriting with CDR-CONS, ADD1-EQUAL,
        and CAR-CONS, and unfolding the definitions of MEANING, FORMP,
        LENGTH, NUMBERP, FORM-LSTP, and EQUAL, to:

              T.

Case 7. (IMPLIES
	 (AND (FORMP X)
	      (LISTP X)
	      (EQUAL (CAR X) 'EQUAL)
	      (LISTP (CADR X))
	      (EQUAL (CAADR X) 'PLUS)
	      (NOT (LISTP (CADDR X)))
	      (MEMBER (CADDR X)
		      (PLUS-FRINGE (CADR X))))
	 (EQUAL
	  (MEANING X A)
	  (MEANING
	   (CONS 'IF
	    (CONS
	     (LIST 'NUMBERP (CADDR X))
	     (CONS
	       (CONS 'EQUAL
		     (CONS (PLUS-TREE (DELETE (CADDR X)
					      (PLUS-FRINGE (CADR X))))
			   '('0)))
	       '('1FALSE))))
	   A))),

  which again simplifies, applying CAR-CONS, CDR-CONS,
  MEMBER-IMPLIES-NUMBERP, PLUS-TREE-PLUS-FRINGE, PLUS-TREE-DELETE,
  and EQUAL-DIFFERENCE-0, and expanding the functions MEANING and CAR,
  to three new goals:

  Case 7.3.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'PLUS)
			(NOT (LISTP (CADDR X)))
			(MEMBER (CADDR X)
				(PLUS-FRINGE (CADR X)))
			(LESSP (MEANING (CADDR X) A)
			       (MEANING (CADR X) A)))
		   (EQUAL (MEANING X A) F)).

    This simplifies again, clearly, to:

          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'PLUS)
			(NOT (LISTP (CADDR X)))
			(MEMBER (CADDR X)
				(PLUS-FRINGE (CADR X)))
			(LESSP (MEANING (CADDR X) A)
			       (MEANING (CADR X) A)))
		   (NOT (MEANING X A))).

    Appealing to the lemma CAR-CDR-ELIM, we now replace X by
    (CONS Z V) to eliminate (CAR X) and (CDR X), V by (CONS W D) to
    eliminate (CAR V) and (CDR V), W by (CONS V C) to eliminate
    (CAR W) and (CDR W), and D by (CONS W X1) to eliminate (CAR D)
    and (CDR D).  We would thus like to prove three new conjectures:

    Case 7.3.3.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'EQUAL)
			  (LISTP (CAR V))
			  (EQUAL (CAAR V) 'PLUS)
			  (NOT (LISTP (CADR V)))
			  (MEMBER (CADR V)
				  (PLUS-FRINGE (CAR V)))
			  (LESSP (MEANING (CADR V) A)
				 (MEANING (CAR V) A)))
		     (NOT (MEANING (CONS Z V) A))),

      which further simplifies, unfolding the functions FORMP, LENGTH,
      and EQUAL, to:

            T.

    Case 7.3.2.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z (CONS (CONS V C) D)))
			  (EQUAL Z 'EQUAL)
			  (EQUAL V 'PLUS)
			  (NOT (LISTP (CAR D)))
			  (MEMBER (CAR D)
				  (PLUS-FRINGE (CONS V C)))
			  (LESSP (MEANING (CAR D) A)
				 (MEANING (CONS V C) A)))
		     (NOT (MEANING (CONS Z (CONS (CONS V C) D))
				   A))).

      This further simplifies, appealing to the lemma CDR-CONS, and
      opening up FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 7.3.1.
            (IMPLIES
		  (AND (FORMP (CONS Z
				    (CONS (CONS V C) (CONS W X1))))
		       (EQUAL Z 'EQUAL)
		       (EQUAL V 'PLUS)
		       (NOT (LISTP W))
		       (MEMBER W (PLUS-FRINGE (CONS V C)))
		       (LESSP (MEANING W A)
			      (MEANING (CONS V C) A)))
		  (NOT (MEANING (CONS Z (CONS (CONS V C) (CONS W X1)))
				A))).

      However this simplifies further, applying CDR-CONS, ADD1-EQUAL,
      and CAR-CONS, and unfolding the definitions of FORMP, LENGTH,
      NUMBERP, FORM-LSTP, and MEANING, to the new goal:

            (IMPLIES (AND (EQUAL 0 (LENGTH X1))
			  (EQUAL 2 (LENGTH C))
			  (FORM-LSTP C)
			  (FORMP W)
			  (FORM-LSTP X1)
			  (NOT (LISTP W))
			  (MEMBER W
				  (PLUS-FRINGE (CONS 'PLUS C)))
			  (LESSP (MEANING W A)
				 (PLUS (MEANING (CAR C) A)
				       (MEANING (CADR C) A))))
		     (NOT (EQUAL (PLUS (MEANING (CAR C) A)
				       (MEANING (CADR C) A))
				 (MEANING W A)))).

      However this simplifies finally, using linear arithmetic, to:

            T.

  Case 7.2.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'PLUS)
			(NOT (LISTP (CADDR X)))
			(MEMBER (CADDR X)
				(PLUS-FRINGE (CADR X)))
			(NOT (NUMBERP (MEANING (CADDR X) A))))
		   (EQUAL (MEANING X A) F)),

    which we again simplify, obviously, to:

          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'PLUS)
			(NOT (LISTP (CADDR X)))
			(MEMBER (CADDR X)
				(PLUS-FRINGE (CADR X)))
			(NOT (NUMBERP (MEANING (CADDR X) A))))
		   (NOT (MEANING X A))).

    Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
    eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate
    (CAR V) and (CDR V), W by (CONS V C) to eliminate (CAR W) and
    (CDR W), and D by (CONS W X1) to eliminate (CAR D) and (CDR D).
    This produces three new formulas:

    Case 7.2.3.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'EQUAL)
			  (LISTP (CAR V))
			  (EQUAL (CAAR V) 'PLUS)
			  (NOT (LISTP (CADR V)))
			  (MEMBER (CADR V)
				  (PLUS-FRINGE (CAR V)))
			  (NOT (NUMBERP (MEANING (CADR V) A))))
		     (NOT (MEANING (CONS Z V) A))).

      However this simplifies further, opening up FORMP, LENGTH, and
      EQUAL, to:

            T.

    Case 7.2.2.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z (CONS (CONS V C) D)))
			  (EQUAL Z 'EQUAL)
			  (EQUAL V 'PLUS)
			  (NOT (LISTP (CAR D)))
			  (MEMBER (CAR D)
				  (PLUS-FRINGE (CONS V C)))
			  (NOT (NUMBERP (MEANING (CAR D) A))))
		     (NOT (MEANING (CONS Z (CONS (CONS V C) D))
				   A))),

      which further simplifies, rewriting with the lemma CDR-CONS,
      and opening up the definitions of FORMP, LENGTH, ADD1, and
      EQUAL, to:

            T.

    Case 7.2.1.
            (IMPLIES
		  (AND (FORMP (CONS Z
				    (CONS (CONS V C) (CONS W X1))))
		       (EQUAL Z 'EQUAL)
		       (EQUAL V 'PLUS)
		       (NOT (LISTP W))
		       (MEMBER W (PLUS-FRINGE (CONS V C)))
		       (NOT (NUMBERP (MEANING W A))))
		  (NOT (MEANING (CONS Z (CONS (CONS V C) (CONS W X1)))
				A))),

      which further simplifies, appealing to the lemmas CDR-CONS,
      ADD1-EQUAL, and CAR-CONS, and opening up FORMP, LENGTH, NUMBERP,
      FORM-LSTP, and MEANING, to:

            T.

  Case 7.1.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'PLUS)
			(NOT (LISTP (CADDR X)))
			(MEMBER (CADDR X)
				(PLUS-FRINGE (CADR X)))
			(NUMBERP (MEANING (CADDR X) A))
			( LEQ
			  (MEANING (CADR X) A)
			  (MEANING (CADDR X) A)))
		   (EQUAL (MEANING X A) T)),

    which we again simplify, using linear arithmetic and applying
    MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, PLUS-TREE-PLUS-FRINGE, and
    MEMBER-IMPLIES-NUMBERP, to the following two new conjectures:

    Case 7.1.2.
            (IMPLIES (AND (NOT (NUMBERP (MEANING (CADR X) A)))
			  (FORMP X)
			  (LISTP X)
			  (EQUAL (CAR X) 'EQUAL)
			  (LISTP (CADR X))
			  (EQUAL (CAADR X) 'PLUS)
			  (NOT (LISTP (CADDR X)))
			  (MEMBER (CADDR X)
				  (PLUS-FRINGE (CADR X)))
			  (NUMBERP (MEANING (CADDR X) A))
			  ( LEQ
			    (MEANING (CADR X) A)
			    (MEANING (CADDR X) A)))
		     (EQUAL (MEANING X A) T)),

      which we again simplify, applying the lemma
      MEMBER-IMPLIES-NUMBERP, to:

            T.

    Case 7.1.1.
            (IMPLIES (AND (NUMBERP (MEANING (CADR X) A))
			  (EQUAL (MEANING (CADDR X) A)
				 (MEANING (CADR X) A))
			  (FORMP X)
			  (LISTP X)
			  (EQUAL (CAR X) 'EQUAL)
			  (LISTP (CADR X))
			  (EQUAL (CAADR X) 'PLUS)
			  (NOT (LISTP (CADDR X)))
			  (MEMBER (CADDR X)
				  (PLUS-FRINGE (CADR X)))
			  ( LEQ
			    (MEANING (CADR X) A)
			    (MEANING (CADR X) A)))
		     (EQUAL (MEANING X A) T)),

      which we again simplify, rewriting with NUMBERP-MEANING-PLUS
      and MEMBER-IMPLIES-NUMBERP, to:

            (IMPLIES (AND (EQUAL (MEANING (CADDR X) A)
				 (MEANING (CADR X) A))
			  (FORMP X)
			  (LISTP X)
			  (EQUAL (CAR X) 'EQUAL)
			  (LISTP (CADR X))
			  (EQUAL (CAADR X) 'PLUS)
			  (NOT (LISTP (CADDR X)))
			  (MEMBER (CADDR X)
				  (PLUS-FRINGE (CADR X)))
			  ( LEQ
			    (MEANING (CADR X) A)
			    (MEANING (CADR X) A)))
		     (EQUAL (MEANING X A) T)).

      Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS V Z)
      to eliminate (CDR X) and (CAR X), Z by (CONS D W) to eliminate
      (CDR Z) and (CAR Z), W by (CONS Z C) to eliminate (CAR W) and
      (CDR W), D by (CONS W X1) to eliminate (CAR D) and (CDR D), and
      D by (CONS Z C) to eliminate (CAR D) and (CDR D).  We must thus
      prove the following three new formulas:

      Case 7.1.1.3.
              (IMPLIES (AND (NOT (LISTP Z))
			    (EQUAL (MEANING (CADR Z) A)
				   (MEANING (CAR Z) A))
			    (FORMP (CONS V Z))
			    (EQUAL V 'EQUAL)
			    (LISTP (CAR Z))
			    (EQUAL (CAAR Z) 'PLUS)
			    (NOT (LISTP (CADR Z)))
			    (MEMBER (CADR Z)
				    (PLUS-FRINGE (CAR Z)))
			    ( LEQ
			      (MEANING (CAR Z) A)
			      (MEANING (CAR Z) A)))
		       (EQUAL (MEANING (CONS V Z) A) T)),

        which finally simplifies, rewriting with CDR-NLISTP and
        CAR-NLISTP, and expanding CAR, MEANING, FORMP, LENGTH, and
        EQUAL, to:

              T.

      Case 7.1.1.2.
              (IMPLIES (AND (NOT (LISTP W))
			    (EQUAL (MEANING (CAR W) A)
				   (MEANING (CONS Z C) A))
			    (FORMP (CONS V (CONS (CONS Z C) W)))
			    (EQUAL V 'EQUAL)
			    (EQUAL Z 'PLUS)
			    (NOT (LISTP (CAR W)))
			    (MEMBER (CAR W)
				    (PLUS-FRINGE (CONS Z C)))
			    ( LEQ
			      (MEANING (CONS Z C) A)
			      (MEANING (CONS Z C) A)))
		       (EQUAL (MEANING (CONS V (CONS (CONS Z C) W))
				       A)
			      T)),

        which finally simplifies, applying CAR-NLISTP and CDR-CONS,
        and unfolding the functions MEANING, FORMP, LENGTH, ADD1, and
        EQUAL, to:

              T.

      Case 7.1.1.1.
              (IMPLIES
		(AND (EQUAL (MEANING Z A)
			    (MEANING (CONS W X1) A))
		     (FORMP (CONS V
				  (CONS (CONS W X1) (CONS Z C))))
		     (EQUAL V 'EQUAL)
		     (EQUAL W 'PLUS)
		     (NOT (LISTP Z))
		     (MEMBER Z (PLUS-FRINGE (CONS W X1)))
		     ( LEQ
		       (MEANING (CONS W X1) A)
		       (MEANING (CONS W X1) A)))
		(EQUAL (MEANING (CONS V (CONS (CONS W X1) (CONS Z C)))
				A)
		       T)),

        which we finally simplify, applying CDR-CONS, ADD1-EQUAL, and
        CAR-CONS, and unfolding MEANING, FORMP, LENGTH, NUMBERP,
        FORM-LSTP, and EQUAL, to:

              T.

Case 6. (IMPLIES
	 (AND (FORMP X)
	      (LISTP X)
	      (EQUAL (CAR X) 'EQUAL)
	      (LISTP (CADR X))
	      (EQUAL (CAADR X) 'PLUS)
	      (LISTP (CADDR X))
	      (EQUAL (CAADDR X) 'PLUS))
	 (EQUAL
	  (MEANING X A)
	  (MEANING
	   (LIST 'EQUAL
	       (PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADR X))
				   (BAGINT (PLUS-FRINGE (CADR X))
					   (PLUS-FRINGE (CADDR X)))))
	       (PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADDR X))
				   (BAGINT (PLUS-FRINGE (CADR X))
					   (PLUS-FRINGE (CADDR X))))))
	   A))),

  which we again simplify, applying the lemmas CAR-CONS,
  SUBBAGP-BAGINT1, NUMBERP-MEANING-PLUS, PLUS-TREE-PLUS-FRINGE,
  PLUS-TREE-BAGDIFF, CDR-CONS, SUBBAGP-BAGINT2,
  BRIDGE-TO-SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP, and
  DIFFERENCE-CANCELLATION-1, and opening up the function MEANING, to
  the following two new goals:

  Case 6.2.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'PLUS)
			(LISTP (CADDR X))
			(EQUAL (CAADDR X) 'PLUS)
			(NOT (EQUAL (MEANING (CADR X) A)
				    (MEANING (CADDR X) A))))
		   (NOT (MEANING X A))).

    Appealing to the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
    eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate
    (CAR V) and (CDR V), W by (CONS V C) to eliminate (CAR W) and
    (CDR W), D by (CONS W X1) to eliminate (CAR D) and (CDR D), and W
    by (CONS D Z1) to eliminate (CAR W) and (CDR W).  We must thus
    prove the following three new formulas:

    Case 6.2.3.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'EQUAL)
			  (LISTP (CAR V))
			  (EQUAL (CAAR V) 'PLUS)
			  (LISTP (CADR V))
			  (EQUAL (CAADR V) 'PLUS)
			  (NOT (EQUAL (MEANING (CAR V) A)
				      (MEANING (CADR V) A))))
		     (NOT (MEANING (CONS Z V) A))),

      which we further simplify, expanding FORMP, LENGTH, and EQUAL,
      to:

            T.

    Case 6.2.2.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z (CONS (CONS V C) D)))
			  (EQUAL Z 'EQUAL)
			  (EQUAL V 'PLUS)
			  (LISTP (CAR D))
			  (EQUAL (CAAR D) 'PLUS)
			  (NOT (EQUAL (MEANING (CONS V C) A)
				      (MEANING (CAR D) A))))
		     (NOT (MEANING (CONS Z (CONS (CONS V C) D))
				   A))).

      However this further simplifies, rewriting with CDR-CONS, and
      unfolding FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 6.2.1.
            (IMPLIES (AND (FORMP (CONS Z
				       (CONS (CONS V C)
					     (CONS (CONS D Z1) X1))))
			  (EQUAL Z 'EQUAL)
			  (EQUAL V 'PLUS)
			  (EQUAL D 'PLUS)
			  (NOT (EQUAL (MEANING (CONS V C) A)
				      (MEANING (CONS D Z1) A))))
		     (NOT (MEANING (CONS Z
					 (CONS (CONS V C)
					       (CONS (CONS D Z1) X1)))
				   A))).

      This simplifies further, appealing to the lemmas CDR-CONS,
      ADD1-EQUAL, and CAR-CONS, and expanding FORMP, LENGTH, NUMBERP,
      FORM-LSTP, and MEANING, to:

            T.

  Case 6.1.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'PLUS)
			(LISTP (CADDR X))
			(EQUAL (CAADDR X) 'PLUS)
			(EQUAL (MEANING (CADR X) A)
			       (MEANING (CADDR X) A)))
		   (EQUAL (MEANING X A) T)).

    Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V)
    to eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate
    (CAR V) and (CDR V), W by (CONS V C) to eliminate (CAR W) and
    (CDR W), D by (CONS W X1) to eliminate (CAR D) and (CDR D), and W
    by (CONS D Z1) to eliminate (CAR W) and (CDR W).  This produces
    the following three new formulas:

    Case 6.1.3.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'EQUAL)
			  (LISTP (CAR V))
			  (EQUAL (CAAR V) 'PLUS)
			  (LISTP (CADR V))
			  (EQUAL (CAADR V) 'PLUS)
			  (EQUAL (MEANING (CAR V) A)
				 (MEANING (CADR V) A)))
		     (EQUAL (MEANING (CONS Z V) A) T)),

      which we further simplify, expanding the definitions of FORMP,
      LENGTH, and EQUAL, to:

            T.

    Case 6.1.2.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z (CONS (CONS V C) D)))
			  (EQUAL Z 'EQUAL)
			  (EQUAL V 'PLUS)
			  (LISTP (CAR D))
			  (EQUAL (CAAR D) 'PLUS)
			  (EQUAL (MEANING (CONS V C) A)
				 (MEANING (CAR D) A)))
		     (EQUAL (MEANING (CONS Z (CONS (CONS V C) D))
				     A)
			    T)),

      which we further simplify, rewriting with CDR-CONS, and opening
      up the functions FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 6.1.1.
            (IMPLIES
		   (AND (FORMP (CONS Z
				     (CONS (CONS V C)
					   (CONS (CONS D Z1) X1))))
			(EQUAL Z 'EQUAL)
			(EQUAL V 'PLUS)
			(EQUAL D 'PLUS)
			(EQUAL (MEANING (CONS V C) A)
			       (MEANING (CONS D Z1) A)))
		   (EQUAL (MEANING (CONS Z
					 (CONS (CONS V C)
					       (CONS (CONS D Z1) X1)))
				   A)
			  T)).

      This simplifies further, rewriting with the lemmas CDR-CONS,
      ADD1-EQUAL, and CAR-CONS, and expanding the definitions of
      FORMP, LENGTH, NUMBERP, FORM-LSTP, MEANING, and EQUAL, to:

            T.

Case 5. (IMPLIES
	 (AND (FORMP X)
	      (LISTP X)
	      (EQUAL (CAR X) 'EQUAL)
	      (NOT (EQUAL (CAADR X) 'PLUS))
	      (LISTP (CADDR X))
	      (EQUAL (CAADDR X) 'PLUS)
	      (MEMBER (CADR X)
		      (PLUS-FRINGE (CADDR X))))
	 (FORMP
	  (CONS 'IF
	   (CONS
	     (LIST 'NUMBERP (CADR X))
	     (CONS (LIST 'EQUAL
			 ''0
			 (PLUS-TREE (DELETE (CADR X)
					    (PLUS-FRINGE (CADDR X)))))
		   '('1FALSE)))))),

  which we again simplify, applying CDR-CONS and CAR-CONS, and
  unfolding the functions FORMP, LENGTH, ADD1, EQUAL, FORM-LSTP,
  LISTP, CDR, and CAR, to the following two new formulas:

  Case 5.2.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(NOT (EQUAL (CAADR X) 'PLUS))
			(LISTP (CADDR X))
			(EQUAL (CAADDR X) 'PLUS)
			(MEMBER (CADR X)
				(PLUS-FRINGE (CADDR X))))
		   (FORMP (CADR X))).

    Appealing to the lemma CAR-CDR-ELIM, we now replace X by
    (CONS Z V) to eliminate (CAR X) and (CDR X), V by (CONS W D) to
    eliminate (CAR V) and (CDR V), W by (CONS V C) to eliminate
    (CAR W) and (CDR W), D by (CONS W X1) to eliminate (CAR D) and
    (CDR D), W by (CONS D Z1) to eliminate (CAR W) and (CDR W), D by
    (CONS V C) to eliminate (CAR D) and (CDR D), and V by (CONS D X1)
    to eliminate (CAR V) and (CDR V).  The result is five new goals:

    Case 5.2.5.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'EQUAL)
			  (NOT (EQUAL (CAAR V) 'PLUS))
			  (LISTP (CADR V))
			  (EQUAL (CAADR V) 'PLUS)
			  (MEMBER (CAR V)
				  (PLUS-FRINGE (CADR V))))
		     (FORMP (CAR V))).

      This simplifies further, expanding the functions FORMP, LENGTH,
      and EQUAL, to:

            T.

    Case 5.2.4.
            (IMPLIES (AND (NOT (LISTP D))
			  (NOT (LISTP W))
			  (FORMP (CONS Z (CONS W D)))
			  (EQUAL Z 'EQUAL)
			  (NOT (EQUAL (CAR W) 'PLUS))
			  (LISTP (CAR D))
			  (EQUAL (CAAR D) 'PLUS)
			  (MEMBER W (PLUS-FRINGE (CAR D))))
		     (FORMP W)),

      which we further simplify, applying CDR-CONS, and expanding the
      functions FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 5.2.3.
            (IMPLIES (AND (NOT (LISTP W))
			  (FORMP (CONS Z
				       (CONS W (CONS (CONS D X1) C))))
			  (EQUAL Z 'EQUAL)
			  (NOT (EQUAL (CAR W) 'PLUS))
			  (EQUAL D 'PLUS)
			  (MEMBER W (PLUS-FRINGE (CONS D X1))))
		     (FORMP W)),

      which further simplifies, appealing to the lemmas CDR-CONS,
      ADD1-EQUAL, and CAR-CONS, and expanding the definitions of
      FORMP, LENGTH, NUMBERP, and FORM-LSTP, to:

            T.

    Case 5.2.2.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z (CONS (CONS V C) D)))
			  (EQUAL Z 'EQUAL)
			  (NOT (EQUAL V 'PLUS))
			  (LISTP (CAR D))
			  (EQUAL (CAAR D) 'PLUS)
			  (MEMBER (CONS V C)
				  (PLUS-FRINGE (CAR D))))
		     (FORMP (CONS V C))),

      which we further simplify, applying the lemma CDR-CONS, and
      unfolding the definitions of FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 5.2.1.
            (IMPLIES (AND (FORMP (CONS Z
				       (CONS (CONS V C)
					     (CONS (CONS D Z1) X1))))
			  (EQUAL Z 'EQUAL)
			  (NOT (EQUAL V 'PLUS))
			  (EQUAL D 'PLUS)
			  (MEMBER (CONS V C)
				  (PLUS-FRINGE (CONS D Z1))))
		     (FORMP (CONS V C))).

      However this simplifies further, applying CDR-CONS, ADD1-EQUAL,
      and CAR-CONS, and opening up FORMP, LENGTH, NUMBERP, and
      FORM-LSTP, to:

            T.

  Case 5.1.
          (IMPLIES
		(AND (FORMP X)
		     (LISTP X)
		     (EQUAL (CAR X) 'EQUAL)
		     (NOT (EQUAL (CAADR X) 'PLUS))
		     (LISTP (CADDR X))
		     (EQUAL (CAADDR X) 'PLUS)
		     (MEMBER (CADR X)
			     (PLUS-FRINGE (CADDR X))))
		(FORMP (PLUS-TREE (DELETE (CADR X)
					  (PLUS-FRINGE (CADDR X)))))).

    Appealing to the lemma CAR-CDR-ELIM, we now replace X by
    (CONS Z V) to eliminate (CAR X) and (CDR X), V by (CONS W D) to
    eliminate (CAR V) and (CDR V), W by (CONS V C) to eliminate
    (CAR W) and (CDR W), D by (CONS W X1) to eliminate (CAR D) and
    (CDR D), W by (CONS D Z1) to eliminate (CAR W) and (CDR W), D by
    (CONS V C) to eliminate (CAR D) and (CDR D), and V by (CONS D X1)
    to eliminate (CAR V) and (CDR V).  This produces five new
    formulas:

    Case 5.1.5.
            (IMPLIES
		 (AND (NOT (LISTP V))
		      (FORMP (CONS Z V))
		      (EQUAL Z 'EQUAL)
		      (NOT (EQUAL (CAAR V) 'PLUS))
		      (LISTP (CADR V))
		      (EQUAL (CAADR V) 'PLUS)
		      (MEMBER (CAR V)
			      (PLUS-FRINGE (CADR V))))
		 (FORMP (PLUS-TREE (DELETE (CAR V)
					   (PLUS-FRINGE (CADR V)))))).

      But this further simplifies, opening up the definitions of
      FORMP, LENGTH, and EQUAL, to:

            T.

    Case 5.1.4.
            (IMPLIES
		(AND (NOT (LISTP D))
		     (NOT (LISTP W))
		     (FORMP (CONS Z (CONS W D)))
		     (EQUAL Z 'EQUAL)
		     (NOT (EQUAL (CAR W) 'PLUS))
		     (LISTP (CAR D))
		     (EQUAL (CAAR D) 'PLUS)
		     (MEMBER W (PLUS-FRINGE (CAR D))))
		(FORMP (PLUS-TREE (DELETE W (PLUS-FRINGE (CAR D)))))),

      which we further simplify, applying the lemma CDR-CONS, and
      expanding FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 5.1.3.
            (IMPLIES
	      (AND (NOT (LISTP W))
		   (FORMP (CONS Z
				(CONS W (CONS (CONS D X1) C))))
		   (EQUAL Z 'EQUAL)
		   (NOT (EQUAL (CAR W) 'PLUS))
		   (EQUAL D 'PLUS)
		   (MEMBER W (PLUS-FRINGE (CONS D X1))))
	      (FORMP (PLUS-TREE (DELETE W
					(PLUS-FRINGE (CONS D X1)))))),

      which further simplifies, appealing to the lemmas CDR-CONS,
      ADD1-EQUAL, CAR-CONS, CAR-NLISTP, FORM-LSTP-DELETE,
      FORM-LSTP-PLUS-FRINGE, and FORMP-PLUS-TREE, and opening up
      FORMP, LENGTH, NUMBERP, FORM-LSTP, and EQUAL, to:

            T.

    Case 5.1.2.
            (IMPLIES
		  (AND (NOT (LISTP D))
		       (FORMP (CONS Z (CONS (CONS V C) D)))
		       (EQUAL Z 'EQUAL)
		       (NOT (EQUAL V 'PLUS))
		       (LISTP (CAR D))
		       (EQUAL (CAAR D) 'PLUS)
		       (MEMBER (CONS V C)
			       (PLUS-FRINGE (CAR D))))
		  (FORMP (PLUS-TREE (DELETE (CONS V C)
					    (PLUS-FRINGE (CAR D)))))).

      This further simplifies, applying the lemma CDR-CONS, and
      unfolding FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 5.1.1.
            (IMPLIES
	      (AND (FORMP (CONS Z
				(CONS (CONS V C)
				      (CONS (CONS D Z1) X1))))
		   (EQUAL Z 'EQUAL)
		   (NOT (EQUAL V 'PLUS))
		   (EQUAL D 'PLUS)
		   (MEMBER (CONS V C)
			   (PLUS-FRINGE (CONS D Z1))))
	      (FORMP (PLUS-TREE (DELETE (CONS V C)
					(PLUS-FRINGE (CONS D Z1)))))).

      However this simplifies further, rewriting with the lemmas
      CDR-CONS, ADD1-EQUAL, CAR-CONS, FORM-LSTP-DELETE,
      FORM-LSTP-PLUS-FRINGE, and FORMP-PLUS-TREE, and opening up
      FORMP, LENGTH, NUMBERP, FORM-LSTP, and EQUAL, to:

            T.

Case 4. (IMPLIES
	 (AND (FORMP X)
	      (LISTP X)
	      (EQUAL (CAR X) 'EQUAL)
	      (NOT (LISTP (CADR X)))
	      (LISTP (CADDR X))
	      (EQUAL (CAADDR X) 'PLUS)
	      (MEMBER (CADR X)
		      (PLUS-FRINGE (CADDR X))))
	 (FORMP
	  (CONS 'IF
	   (CONS
	     (LIST 'NUMBERP (CADR X))
	     (CONS (LIST 'EQUAL
			 ''0
			 (PLUS-TREE (DELETE (CADR X)
					    (PLUS-FRINGE (CADDR X)))))
		   '('1FALSE)))))),

  which we again simplify, applying CDR-CONS and CAR-CONS, and
  unfolding the functions FORMP, LENGTH, ADD1, EQUAL, FORM-LSTP,
  LISTP, CDR, and CAR, to the following two new goals:

  Case 4.2.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(NOT (LISTP (CADR X)))
			(LISTP (CADDR X))
			(EQUAL (CAADDR X) 'PLUS)
			(MEMBER (CADR X)
				(PLUS-FRINGE (CADDR X))))
		   (FORMP (CADR X))).

    Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V)
    to eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate
    (CAR V) and (CDR V), D by (CONS V C) to eliminate (CAR D) and
    (CDR D), and V by (CONS D X1) to eliminate (CAR V) and (CDR V).
    We must thus prove three new conjectures:

    Case 4.2.3.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'EQUAL)
			  (NOT (LISTP (CAR V)))
			  (LISTP (CADR V))
			  (EQUAL (CAADR V) 'PLUS)
			  (MEMBER (CAR V)
				  (PLUS-FRINGE (CADR V))))
		     (FORMP (CAR V))),

      which further simplifies, opening up the functions FORMP,
      LENGTH, and EQUAL, to:

            T.

    Case 4.2.2.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z (CONS W D)))
			  (EQUAL Z 'EQUAL)
			  (NOT (LISTP W))
			  (LISTP (CAR D))
			  (EQUAL (CAAR D) 'PLUS)
			  (MEMBER W (PLUS-FRINGE (CAR D))))
		     (FORMP W)),

      which further simplifies, appealing to the lemma CDR-CONS, and
      opening up the functions FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 4.2.1.
            (IMPLIES (AND (FORMP (CONS Z
				       (CONS W (CONS (CONS D X1) C))))
			  (EQUAL Z 'EQUAL)
			  (NOT (LISTP W))
			  (EQUAL D 'PLUS)
			  (MEMBER W (PLUS-FRINGE (CONS D X1))))
		     (FORMP W)),

      which we further simplify, rewriting with CDR-CONS, ADD1-EQUAL,
      and CAR-CONS, and opening up FORMP, LENGTH, NUMBERP, and
      FORM-LSTP, to:

            T.

  Case 4.1.
          (IMPLIES
		(AND (FORMP X)
		     (LISTP X)
		     (EQUAL (CAR X) 'EQUAL)
		     (NOT (LISTP (CADR X)))
		     (LISTP (CADDR X))
		     (EQUAL (CAADDR X) 'PLUS)
		     (MEMBER (CADR X)
			     (PLUS-FRINGE (CADDR X))))
		(FORMP (PLUS-TREE (DELETE (CADR X)
					  (PLUS-FRINGE (CADDR X)))))).

    Appealing to the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
    eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate
    (CAR V) and (CDR V), D by (CONS V C) to eliminate (CAR D) and
    (CDR D), and V by (CONS D X1) to eliminate (CAR V) and (CDR V).
    We would thus like to prove the following three new conjectures:

    Case 4.1.3.
            (IMPLIES
		 (AND (NOT (LISTP V))
		      (FORMP (CONS Z V))
		      (EQUAL Z 'EQUAL)
		      (NOT (LISTP (CAR V)))
		      (LISTP (CADR V))
		      (EQUAL (CAADR V) 'PLUS)
		      (MEMBER (CAR V)
			      (PLUS-FRINGE (CADR V))))
		 (FORMP (PLUS-TREE (DELETE (CAR V)
					   (PLUS-FRINGE (CADR V)))))).

      But this simplifies further, expanding the definitions of FORMP,
      LENGTH, and EQUAL, to:

            T.

    Case 4.1.2.
            (IMPLIES
		(AND (NOT (LISTP D))
		     (FORMP (CONS Z (CONS W D)))
		     (EQUAL Z 'EQUAL)
		     (NOT (LISTP W))
		     (LISTP (CAR D))
		     (EQUAL (CAAR D) 'PLUS)
		     (MEMBER W (PLUS-FRINGE (CAR D))))
		(FORMP (PLUS-TREE (DELETE W (PLUS-FRINGE (CAR D)))))),

      which further simplifies, applying CDR-CONS, and opening up the
      functions FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 4.1.1.
            (IMPLIES
	      (AND (FORMP (CONS Z
				(CONS W (CONS (CONS D X1) C))))
		   (EQUAL Z 'EQUAL)
		   (NOT (LISTP W))
		   (EQUAL D 'PLUS)
		   (MEMBER W (PLUS-FRINGE (CONS D X1))))
	      (FORMP (PLUS-TREE (DELETE W
					(PLUS-FRINGE (CONS D X1)))))),

      which we further simplify, applying CDR-CONS, ADD1-EQUAL,
      CAR-CONS, FORM-LSTP-DELETE, FORM-LSTP-PLUS-FRINGE, and
      FORMP-PLUS-TREE, and expanding the definitions of FORMP, LENGTH,
      NUMBERP, FORM-LSTP, and EQUAL, to:

            T.

Case 3. (IMPLIES
	 (AND (FORMP X)
	      (LISTP X)
	      (EQUAL (CAR X) 'EQUAL)
	      (LISTP (CADR X))
	      (EQUAL (CAADR X) 'PLUS)
	      (NOT (EQUAL (CAADDR X) 'PLUS))
	      (MEMBER (CADDR X)
		      (PLUS-FRINGE (CADR X))))
	 (FORMP
	  (CONS 'IF
	   (CONS
	    (LIST 'NUMBERP (CADDR X))
	    (CONS
	       (CONS 'EQUAL
		     (CONS (PLUS-TREE (DELETE (CADDR X)
					      (PLUS-FRINGE (CADR X))))
			   '('0)))
	       '('1FALSE)))))),

  which again simplifies, rewriting with CDR-CONS and CAR-CONS, and
  unfolding FORMP, LENGTH, ADD1, EQUAL, FORM-LSTP, LISTP, CDR, and
  CAR, to the following two new formulas:

  Case 3.2.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'PLUS)
			(NOT (EQUAL (CAADDR X) 'PLUS))
			(MEMBER (CADDR X)
				(PLUS-FRINGE (CADR X))))
		   (FORMP (CADDR X))).

    Appealing to the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
    eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate
    (CAR V) and (CDR V), W by (CONS V C) to eliminate (CAR W) and
    (CDR W), D by (CONS W X1) to eliminate (CAR D) and (CDR D), and W
    by (CONS D Z1) to eliminate (CAR W) and (CDR W).  This produces
    the following four new conjectures:

    Case 3.2.4.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'EQUAL)
			  (LISTP (CAR V))
			  (EQUAL (CAAR V) 'PLUS)
			  (NOT (EQUAL (CAADR V) 'PLUS))
			  (MEMBER (CADR V)
				  (PLUS-FRINGE (CAR V))))
		     (FORMP (CADR V))).

      However this further simplifies, expanding the functions FORMP,
      LENGTH, and EQUAL, to:

            T.

    Case 3.2.3.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z (CONS (CONS V C) D)))
			  (EQUAL Z 'EQUAL)
			  (EQUAL V 'PLUS)
			  (NOT (EQUAL (CAAR D) 'PLUS))
			  (MEMBER (CAR D)
				  (PLUS-FRINGE (CONS V C))))
		     (FORMP (CAR D))),

      which further simplifies, rewriting with the lemma CDR-CONS,
      and opening up the functions FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 3.2.2.
            (IMPLIES (AND (NOT (LISTP W))
			  (FORMP (CONS Z
				       (CONS (CONS V C) (CONS W X1))))
			  (EQUAL Z 'EQUAL)
			  (EQUAL V 'PLUS)
			  (NOT (EQUAL (CAR W) 'PLUS))
			  (MEMBER W (PLUS-FRINGE (CONS V C))))
		     (FORMP W)).

      But this simplifies further, rewriting with CDR-CONS,
      ADD1-EQUAL, and CAR-CONS, and expanding the definitions of
      FORMP, LENGTH, NUMBERP, and FORM-LSTP, to:

            T.

    Case 3.2.1.
            (IMPLIES (AND (FORMP (CONS Z
				       (CONS (CONS V C)
					     (CONS (CONS D Z1) X1))))
			  (EQUAL Z 'EQUAL)
			  (EQUAL V 'PLUS)
			  (NOT (EQUAL D 'PLUS))
			  (MEMBER (CONS D Z1)
				  (PLUS-FRINGE (CONS V C))))
		     (FORMP (CONS D Z1))).

      This simplifies further, applying CDR-CONS, ADD1-EQUAL, and
      CAR-CONS, and opening up FORMP, LENGTH, NUMBERP, and FORM-LSTP,
      to:

            T.

  Case 3.1.
          (IMPLIES
		 (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'EQUAL)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'PLUS)
		      (NOT (EQUAL (CAADDR X) 'PLUS))
		      (MEMBER (CADDR X)
			      (PLUS-FRINGE (CADR X))))
		 (FORMP (PLUS-TREE (DELETE (CADDR X)
					   (PLUS-FRINGE (CADR X)))))).

    Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V)
    to eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate
    (CAR V) and (CDR V), W by (CONS V C) to eliminate (CAR W) and
    (CDR W), D by (CONS W X1) to eliminate (CAR D) and (CDR D), and W
    by (CONS D Z1) to eliminate (CAR W) and (CDR W).  We thus obtain
    the following four new goals:

    Case 3.1.4.
            (IMPLIES
		  (AND (NOT (LISTP V))
		       (FORMP (CONS Z V))
		       (EQUAL Z 'EQUAL)
		       (LISTP (CAR V))
		       (EQUAL (CAAR V) 'PLUS)
		       (NOT (EQUAL (CAADR V) 'PLUS))
		       (MEMBER (CADR V)
			       (PLUS-FRINGE (CAR V))))
		  (FORMP (PLUS-TREE (DELETE (CADR V)
					    (PLUS-FRINGE (CAR V)))))),

      which we further simplify, unfolding the definitions of FORMP,
      LENGTH, and EQUAL, to:

            T.

    Case 3.1.3.
            (IMPLIES
	       (AND (NOT (LISTP D))
		    (FORMP (CONS Z (CONS (CONS V C) D)))
		    (EQUAL Z 'EQUAL)
		    (EQUAL V 'PLUS)
		    (NOT (EQUAL (CAAR D) 'PLUS))
		    (MEMBER (CAR D)
			    (PLUS-FRINGE (CONS V C))))
	       (FORMP (PLUS-TREE (DELETE (CAR D)
					 (PLUS-FRINGE (CONS V C)))))),

      which we further simplify, rewriting with CDR-CONS, and opening
      up FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 3.1.2.
            (IMPLIES
	       (AND (NOT (LISTP W))
		    (FORMP (CONS Z
				 (CONS (CONS V C) (CONS W X1))))
		    (EQUAL Z 'EQUAL)
		    (EQUAL V 'PLUS)
		    (NOT (EQUAL (CAR W) 'PLUS))
		    (MEMBER W (PLUS-FRINGE (CONS V C))))
	       (FORMP (PLUS-TREE (DELETE W
					 (PLUS-FRINGE (CONS V C)))))).

      However this simplifies further, applying CDR-CONS, ADD1-EQUAL,
      CAR-CONS, CAR-NLISTP, FORM-LSTP-DELETE, FORM-LSTP-PLUS-FRINGE,
      and FORMP-PLUS-TREE, and unfolding the functions FORMP, LENGTH,
      NUMBERP, FORM-LSTP, and EQUAL, to:

            T.

    Case 3.1.1.
            (IMPLIES
	       (AND (FORMP (CONS Z
				 (CONS (CONS V C)
				       (CONS (CONS D Z1) X1))))
		    (EQUAL Z 'EQUAL)
		    (EQUAL V 'PLUS)
		    (NOT (EQUAL D 'PLUS))
		    (MEMBER (CONS D Z1)
			    (PLUS-FRINGE (CONS V C))))
	       (FORMP (PLUS-TREE (DELETE (CONS D Z1)
					 (PLUS-FRINGE (CONS V C)))))).

      But this simplifies further, applying the lemmas CDR-CONS,
      ADD1-EQUAL, CAR-CONS, FORM-LSTP-DELETE, FORM-LSTP-PLUS-FRINGE,
      and FORMP-PLUS-TREE, and unfolding FORMP, LENGTH, NUMBERP,
      FORM-LSTP, and EQUAL, to:

            T.

Case 2. (IMPLIES
	 (AND (FORMP X)
	      (LISTP X)
	      (EQUAL (CAR X) 'EQUAL)
	      (LISTP (CADR X))
	      (EQUAL (CAADR X) 'PLUS)
	      (NOT (LISTP (CADDR X)))
	      (MEMBER (CADDR X)
		      (PLUS-FRINGE (CADR X))))
	 (FORMP
	  (CONS 'IF
	   (CONS
	    (LIST 'NUMBERP (CADDR X))
	    (CONS
	       (CONS 'EQUAL
		     (CONS (PLUS-TREE (DELETE (CADDR X)
					      (PLUS-FRINGE (CADR X))))
			   '('0)))
	       '('1FALSE)))))),

  which again simplifies, applying CDR-CONS and CAR-CONS, and
  expanding the functions FORMP, LENGTH, ADD1, EQUAL, FORM-LSTP,
  LISTP, CDR, and CAR, to two new formulas:

  Case 2.2.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'EQUAL)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'PLUS)
			(NOT (LISTP (CADDR X)))
			(MEMBER (CADDR X)
				(PLUS-FRINGE (CADR X))))
		   (FORMP (CADDR X))).

    Appealing to the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
    eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate
    (CAR V) and (CDR V), W by (CONS V C) to eliminate (CAR W) and
    (CDR W), and D by (CONS W X1) to eliminate (CAR D) and (CDR D).
    We thus obtain the following three new formulas:

    Case 2.2.3.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'EQUAL)
			  (LISTP (CAR V))
			  (EQUAL (CAAR V) 'PLUS)
			  (NOT (LISTP (CADR V)))
			  (MEMBER (CADR V)
				  (PLUS-FRINGE (CAR V))))
		     (FORMP (CADR V))),

      which further simplifies, opening up FORMP, LENGTH, and EQUAL,
      to:

            T.

    Case 2.2.2.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z (CONS (CONS V C) D)))
			  (EQUAL Z 'EQUAL)
			  (EQUAL V 'PLUS)
			  (NOT (LISTP (CAR D)))
			  (MEMBER (CAR D)
				  (PLUS-FRINGE (CONS V C))))
		     (FORMP (CAR D))).

      But this simplifies further, rewriting with CDR-CONS, and
      opening up the functions FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 2.2.1.
            (IMPLIES (AND (FORMP (CONS Z
				       (CONS (CONS V C) (CONS W X1))))
			  (EQUAL Z 'EQUAL)
			  (EQUAL V 'PLUS)
			  (NOT (LISTP W))
			  (MEMBER W (PLUS-FRINGE (CONS V C))))
		     (FORMP W)),

      which we further simplify, applying CDR-CONS, ADD1-EQUAL, and
      CAR-CONS, and expanding FORMP, LENGTH, NUMBERP, and FORM-LSTP,
      to:

            T.

  Case 2.1.
          (IMPLIES
		 (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'EQUAL)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'PLUS)
		      (NOT (LISTP (CADDR X)))
		      (MEMBER (CADDR X)
			      (PLUS-FRINGE (CADR X))))
		 (FORMP (PLUS-TREE (DELETE (CADDR X)
					   (PLUS-FRINGE (CADR X)))))).

    Appealing to the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
    eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate
    (CAR V) and (CDR V), W by (CONS V C) to eliminate (CAR W) and
    (CDR W), and D by (CONS W X1) to eliminate (CAR D) and (CDR D).
    The result is the following three new conjectures:

    Case 2.1.3.
            (IMPLIES
		  (AND (NOT (LISTP V))
		       (FORMP (CONS Z V))
		       (EQUAL Z 'EQUAL)
		       (LISTP (CAR V))
		       (EQUAL (CAAR V) 'PLUS)
		       (NOT (LISTP (CADR V)))
		       (MEMBER (CADR V)
			       (PLUS-FRINGE (CAR V))))
		  (FORMP (PLUS-TREE (DELETE (CADR V)
					    (PLUS-FRINGE (CAR V)))))),

      which further simplifies, opening up the definitions of FORMP,
      LENGTH, and EQUAL, to:

            T.

    Case 2.1.2.
            (IMPLIES
	       (AND (NOT (LISTP D))
		    (FORMP (CONS Z (CONS (CONS V C) D)))
		    (EQUAL Z 'EQUAL)
		    (EQUAL V 'PLUS)
		    (NOT (LISTP (CAR D)))
		    (MEMBER (CAR D)
			    (PLUS-FRINGE (CONS V C))))
	       (FORMP (PLUS-TREE (DELETE (CAR D)
					 (PLUS-FRINGE (CONS V C)))))).

      This simplifies further, rewriting with CDR-CONS, and unfolding
      the definitions of FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 2.1.1.
            (IMPLIES
	       (AND (FORMP (CONS Z
				 (CONS (CONS V C) (CONS W X1))))
		    (EQUAL Z 'EQUAL)
		    (EQUAL V 'PLUS)
		    (NOT (LISTP W))
		    (MEMBER W (PLUS-FRINGE (CONS V C))))
	       (FORMP (PLUS-TREE (DELETE W
					 (PLUS-FRINGE (CONS V C)))))).

      However this further simplifies, appealing to the lemmas
      CDR-CONS, ADD1-EQUAL, CAR-CONS, FORM-LSTP-DELETE,
      FORM-LSTP-PLUS-FRINGE, and FORMP-PLUS-TREE, and unfolding FORMP,
      LENGTH, NUMBERP, FORM-LSTP, and EQUAL, to:

            T.

Case 1. (IMPLIES
	 (AND (FORMP X)
	      (LISTP X)
	      (EQUAL (CAR X) 'EQUAL)
	      (LISTP (CADR X))
	      (EQUAL (CAADR X) 'PLUS)
	      (LISTP (CADDR X))
	      (EQUAL (CAADDR X) 'PLUS))
	 (FORMP
	  (LIST 'EQUAL
	    (PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADR X))
				(BAGINT (PLUS-FRINGE (CADR X))
					(PLUS-FRINGE (CADDR X)))))
	    (PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADDR X))
				(BAGINT (PLUS-FRINGE (CADR X))
					(PLUS-FRINGE (CADDR X)))))))).

  This simplifies again, rewriting with CDR-CONS and CAR-CONS, and
  expanding the definitions of FORMP, LENGTH, ADD1, EQUAL, FORM-LSTP,
  and LISTP, to two new conjectures:

  Case 1.2.
          (IMPLIES
	   (AND (FORMP X)
		(LISTP X)
		(EQUAL (CAR X) 'EQUAL)
		(LISTP (CADR X))
		(EQUAL (CAADR X) 'PLUS)
		(LISTP (CADDR X))
		(EQUAL (CAADDR X) 'PLUS))
	   (FORMP
	     (PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADR X))
				 (BAGINT (PLUS-FRINGE (CADR X))
					 (PLUS-FRINGE (CADDR X))))))).

    Appealing to the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
    eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate
    (CAR V) and (CDR V), W by (CONS V C) to eliminate (CAR W) and
    (CDR W), D by (CONS W X1) to eliminate (CAR D) and (CDR D), and W
    by (CONS D Z1) to eliminate (CAR W) and (CDR W).  We would thus
    like to prove the following three new goals:

    Case 1.2.3.
            (IMPLIES
	     (AND (NOT (LISTP V))
		  (FORMP (CONS Z V))
		  (EQUAL Z 'EQUAL)
		  (LISTP (CAR V))
		  (EQUAL (CAAR V) 'PLUS)
		  (LISTP (CADR V))
		  (EQUAL (CAADR V) 'PLUS))
	     (FORMP
	      (PLUS-TREE (BAGDIFF (PLUS-FRINGE (CAR V))
				  (BAGINT (PLUS-FRINGE (CAR V))
					  (PLUS-FRINGE (CADR V))))))).

      But this simplifies further, expanding the definitions of FORMP,
      LENGTH, and EQUAL, to:

            T.

    Case 1.2.2.
            (IMPLIES
	     (AND (NOT (LISTP D))
		  (FORMP (CONS Z (CONS (CONS V C) D)))
		  (EQUAL Z 'EQUAL)
		  (EQUAL V 'PLUS)
		  (LISTP (CAR D))
		  (EQUAL (CAAR D) 'PLUS))
	     (FORMP
	       (PLUS-TREE (BAGDIFF (PLUS-FRINGE (CONS V C))
				   (BAGINT (PLUS-FRINGE (CONS V C))
					   (PLUS-FRINGE (CAR D))))))),

      which further simplifies, applying CDR-CONS, and opening up the
      functions FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 1.2.1.
            (IMPLIES
	     (AND (FORMP (CONS Z
			       (CONS (CONS V C)
				     (CONS (CONS D Z1) X1))))
		  (EQUAL Z 'EQUAL)
		  (EQUAL V 'PLUS)
		  (EQUAL D 'PLUS))
	     (FORMP
	      (PLUS-TREE
		      (BAGDIFF (PLUS-FRINGE (CONS V C))
			       (BAGINT (PLUS-FRINGE (CONS V C))
				       (PLUS-FRINGE (CONS D Z1))))))),

      which further simplifies, appealing to the lemmas CDR-CONS,
      ADD1-EQUAL, CAR-CONS, FORM-LSTP-BAGDIFF, FORM-LSTP-PLUS-FRINGE,
      and FORMP-PLUS-TREE, and opening up the definitions of FORMP,
      LENGTH, NUMBERP, FORM-LSTP, and EQUAL, to:

            T.

  Case 1.1.
          (IMPLIES
	   (AND (FORMP X)
		(LISTP X)
		(EQUAL (CAR X) 'EQUAL)
		(LISTP (CADR X))
		(EQUAL (CAADR X) 'PLUS)
		(LISTP (CADDR X))
		(EQUAL (CAADDR X) 'PLUS))
	   (FORMP
	     (PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADDR X))
				 (BAGINT (PLUS-FRINGE (CADR X))
					 (PLUS-FRINGE (CADDR X))))))).

    Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
    eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate
    (CAR V) and (CDR V), W by (CONS V C) to eliminate (CAR W) and
    (CDR W), D by (CONS W X1) to eliminate (CAR D) and (CDR D), and W
    by (CONS D Z1) to eliminate (CAR W) and (CDR W).  This generates
    the following three new goals:

    Case 1.1.3.
            (IMPLIES
	     (AND (NOT (LISTP V))
		  (FORMP (CONS Z V))
		  (EQUAL Z 'EQUAL)
		  (LISTP (CAR V))
		  (EQUAL (CAAR V) 'PLUS)
		  (LISTP (CADR V))
		  (EQUAL (CAADR V) 'PLUS))
	     (FORMP
	      (PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADR V))
				  (BAGINT (PLUS-FRINGE (CAR V))
					  (PLUS-FRINGE (CADR V))))))).

      However this simplifies further, expanding the functions FORMP,
      LENGTH, and EQUAL, to:

            T.

    Case 1.1.2.
            (IMPLIES
	     (AND (NOT (LISTP D))
		  (FORMP (CONS Z (CONS (CONS V C) D)))
		  (EQUAL Z 'EQUAL)
		  (EQUAL V 'PLUS)
		  (LISTP (CAR D))
		  (EQUAL (CAAR D) 'PLUS))
	     (FORMP
	       (PLUS-TREE (BAGDIFF (PLUS-FRINGE (CAR D))
				   (BAGINT (PLUS-FRINGE (CONS V C))
					   (PLUS-FRINGE (CAR D))))))),

      which further simplifies, applying CDR-CONS, and unfolding the
      definitions of FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 1.1.1.
            (IMPLIES
	     (AND (FORMP (CONS Z
			       (CONS (CONS V C)
				     (CONS (CONS D Z1) X1))))
		  (EQUAL Z 'EQUAL)
		  (EQUAL V 'PLUS)
		  (EQUAL D 'PLUS))
	     (FORMP
	      (PLUS-TREE
		      (BAGDIFF (PLUS-FRINGE (CONS D Z1))
			       (BAGINT (PLUS-FRINGE (CONS V C))
				       (PLUS-FRINGE (CONS D Z1))))))).

      However this further simplifies, rewriting with the lemmas
      CDR-CONS, ADD1-EQUAL, CAR-CONS, FORM-LSTP-BAGDIFF,
      FORM-LSTP-PLUS-FRINGE, and FORMP-PLUS-TREE, and expanding the
      definitions of FORMP, LENGTH, NUMBERP, FORM-LSTP, and EQUAL, to:

            T.

Q.E.D.


[ 68.718021 9.0059794 ]

CORRECTNESS-OF-CANCEL 


(DEFN REVERSE
      (X)
      (IF (LISTP X)
	  (APPEND (REVERSE (CDR X))
		  (CONS (CAR X) NIL))
	  NIL))
     Linear arithmetic and the lemma CDR-LESSP inform us that the
measure (COUNT X) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, REVERSE is accepted under the
definitional principle.  Note that:
      (OR (LITATOM (REVERSE X))
	  (LISTP (REVERSE X)))
is a theorem.




[ 0.080997721 0.0440022787 ]

REVERSE 


(PROVE-LEMMA ASSOCIATIVITY-OF-APPEND
	     (REWRITE)
	     (EQUAL (APPEND (APPEND X Y) Z)
		    (APPEND X (APPEND Y Z))))

     Give the conjecture the name *1.


     Let us appeal to the induction principle.  The recursive terms
in the conjecture suggest three inductions.  They merge into two
likely candidate inductions.  However, only one is unflawed.  We will
induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP X) (P (CDR X) Y Z))
		    (P X Y Z))
	   (IMPLIES (NOT (LISTP X)) (P X Y Z))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
generates two new conjectures:

Case 2. (IMPLIES (AND (LISTP X)
		      (EQUAL (APPEND (APPEND (CDR X) Y) Z)
			     (APPEND (CDR X) (APPEND Y Z))))
		 (EQUAL (APPEND (APPEND X Y) Z)
			(APPEND X (APPEND Y Z)))),

  which simplifies, applying the lemmas CDR-CONS and CAR-CONS, and
  unfolding APPEND, to:

        T.

Case 1. (IMPLIES (NOT (LISTP X))
		 (EQUAL (APPEND (APPEND X Y) Z)
			(APPEND X (APPEND Y Z)))),

  which simplifies, expanding the definition of APPEND, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.248999024 0.157999674 ]

ASSOCIATIVITY-OF-APPEND 


(DEFN PLISTP
      (X)
      (IF (LISTP X)
	  (PLISTP (CDR X))
	  (EQUAL X NIL)))
     Linear arithmetic and the lemma CDR-LESSP establish that the
measure (COUNT X) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, PLISTP is accepted under the
principle of definition.  Observe that:
      (OR (FALSEP (PLISTP X))
	  (TRUEP (PLISTP X)))
is a theorem.




[ 0.0710001625 0.0439982098 ]

PLISTP 


(PROVE-LEMMA APPEND-RIGHT-ID
	     (REWRITE)
	     (IMPLIES (PLISTP X)
		      (EQUAL (APPEND X NIL) X)))

     Call the conjecture *1.


     Perhaps we can prove it by induction.  There are two plausible
inductions.  However, they merge into one likely candidate induction.
We will induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP X) (P (CDR X)))
		    (P X))
	   (IMPLIES (NOT (LISTP X)) (P X))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
produces three new formulas:

Case 3. (IMPLIES (AND (LISTP X)
		      (NOT (PLISTP (CDR X)))
		      (PLISTP X))
		 (EQUAL (APPEND X NIL) X)).

  This simplifies, expanding the definition of PLISTP, to:

        T.

Case 2. (IMPLIES (AND (LISTP X)
		      (EQUAL (APPEND (CDR X) NIL) (CDR X))
		      (PLISTP X))
		 (EQUAL (APPEND X NIL) X)),

  which simplifies, applying the lemma CONS-CAR-CDR, and unfolding
  PLISTP and APPEND, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP X)) (PLISTP X))
		 (EQUAL (APPEND X NIL) X)),

  which simplifies, expanding the definitions of PLISTP, APPEND, and
  EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.181998698 0.169999186 ]

APPEND-RIGHT-ID 


(PROVE-LEMMA PLISTP-REVERSE
	     (GENERALIZE REWRITE)
	     (PLISTP (REVERSE X)))

     Give the conjecture the name *1.


     Let us appeal to the induction principle.  There is only one
suggested induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (AND (LISTP X) (P (CDR X)))
		    (P X))
	   (IMPLIES (NOT (LISTP X)) (P X))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
generates two new conjectures:

Case 2. (IMPLIES (AND (LISTP X)
		      (PLISTP (REVERSE (CDR X))))
		 (PLISTP (REVERSE X))),

  which simplifies, opening up the definition of REVERSE, to:

        (IMPLIES (AND (LISTP X)
		      (PLISTP (REVERSE (CDR X))))
		 (PLISTP (APPEND (REVERSE (CDR X))
				 (LIST (CAR X))))).

  Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS V Z)
  to eliminate (CDR X) and (CAR X).  This generates:

        (IMPLIES (PLISTP (REVERSE Z))
		 (PLISTP (APPEND (REVERSE Z) (LIST V)))),

  which we generalize by replacing (REVERSE Z) by Y.  We would thus
  like to prove the formula:

        (IMPLIES (PLISTP Y)
		 (PLISTP (APPEND Y (LIST V)))),

  which we will name *1.1.

Case 1. (IMPLIES (NOT (LISTP X))
		 (PLISTP (REVERSE X))).

  This simplifies, opening up the functions REVERSE and PLISTP, to:

        T.


     So next consider:

      (IMPLIES (PLISTP Y)
	       (PLISTP (APPEND Y (LIST V)))),

which is formula *1.1 above.  Perhaps we can prove it by induction.
The recursive terms in the conjecture suggest two inductions.
However, they merge into one likely candidate induction.  We will
induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP Y) (P (CDR Y) V))
		    (P Y V))
	   (IMPLIES (NOT (LISTP Y)) (P Y V))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme leads
to three new formulas:

Case 3. (IMPLIES (AND (LISTP Y)
		      (NOT (PLISTP (CDR Y)))
		      (PLISTP Y))
		 (PLISTP (APPEND Y (LIST V)))),

  which simplifies, expanding the definition of PLISTP, to:

        T.

Case 2. (IMPLIES (AND (LISTP Y)
		      (PLISTP (APPEND (CDR Y) (LIST V)))
		      (PLISTP Y))
		 (PLISTP (APPEND Y (LIST V)))),

  which we simplify, rewriting with CDR-CONS, and unfolding the
  definitions of PLISTP and APPEND, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP Y)) (PLISTP Y))
		 (PLISTP (APPEND Y (LIST V)))).

  This simplifies, applying CDR-CONS, and expanding the functions
  PLISTP, LISTP, and APPEND, to:

        T.


     That finishes the proof of *1.1, which finishes the proof of *1.
Q.E.D.


[ 0.482987467 0.37701416 ]

PLISTP-REVERSE 


(PROVE-LEMMA APPEND-REVERSE
	     (REWRITE)
	     (EQUAL (REVERSE (APPEND A B))
		    (APPEND (REVERSE B) (REVERSE A))))

     Give the conjecture the name *1.


     Let us appeal to the induction principle.  The recursive terms
in the conjecture suggest three inductions.  They merge into two
likely candidate inductions.  However, only one is unflawed.  We will
induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP A) (P (CDR A) B))
		    (P A B))
	   (IMPLIES (NOT (LISTP A)) (P A B))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT A) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
generates two new conjectures:

Case 2. (IMPLIES (AND (LISTP A)
		      (EQUAL (REVERSE (APPEND (CDR A) B))
			     (APPEND (REVERSE B)
				     (REVERSE (CDR A)))))
		 (EQUAL (REVERSE (APPEND A B))
			(APPEND (REVERSE B) (REVERSE A)))),

  which simplifies, applying the lemmas CAR-CONS and CDR-CONS, and
  unfolding APPEND and REVERSE, to:

        (IMPLIES (AND (LISTP A)
		      (EQUAL (REVERSE (APPEND (CDR A) B))
			     (APPEND (REVERSE B)
				     (REVERSE (CDR A)))))
		 (EQUAL (APPEND (REVERSE (APPEND (CDR A) B))
				(LIST (CAR A)))
			(APPEND (REVERSE B)
				(APPEND (REVERSE (CDR A))
					(LIST (CAR A)))))).

  Appealing to the lemma CAR-CDR-ELIM, we now replace A by (CONS Z X)
  to eliminate (CDR A) and (CAR A).  We would thus like to prove:

        (IMPLIES (EQUAL (REVERSE (APPEND X B))
			(APPEND (REVERSE B) (REVERSE X)))
		 (EQUAL (APPEND (REVERSE (APPEND X B))
				(LIST Z))
			(APPEND (REVERSE B)
				(APPEND (REVERSE X) (LIST Z))))).

  We use the above equality hypothesis by substituting:
        (APPEND (REVERSE B) (REVERSE X))
  for (REVERSE (APPEND X B)) and throwing away the equality.  We must
  thus prove:

        (EQUAL (APPEND (APPEND (REVERSE B) (REVERSE X))
		       (LIST Z))
	       (APPEND (REVERSE B)
		       (APPEND (REVERSE X) (LIST Z)))),

  which further simplifies, rewriting with ASSOCIATIVITY-OF-APPEND,
  to:

        T.

Case 1. (IMPLIES (NOT (LISTP A))
		 (EQUAL (REVERSE (APPEND A B))
			(APPEND (REVERSE B) (REVERSE A)))).

  This simplifies, rewriting with the lemmas PLISTP-REVERSE and
  APPEND-RIGHT-ID, and expanding APPEND and REVERSE, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 2.10399577 0.282006837 ]

APPEND-REVERSE 


(PROVE-LEMMA TIMES-ZERO2
	     (REWRITE)
	     (IMPLIES (NOT (NUMBERP Y))
		      (EQUAL (TIMES X Y) 0.)))

     Give the conjecture the name *1.


     We will appeal to induction.  There is only one suggested
induction.  We will induct according to the following scheme:
      (AND (IMPLIES (ZEROP X) (P X Y))
	   (IMPLIES (AND (NOT (ZEROP X)) (P (SUB1 X) Y))
		    (P X Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP can be used to establish that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme produces two new
conjectures:

Case 2. (IMPLIES (AND (ZEROP X) (NOT (NUMBERP Y)))
		 (EQUAL (TIMES X Y) 0)).

  This simplifies, opening up the functions ZEROP, EQUAL, and TIMES,
  to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP X))
		      (EQUAL (TIMES (SUB1 X) Y) 0)
		      (NOT (NUMBERP Y)))
		 (EQUAL (TIMES X Y) 0)),

  which simplifies, rewriting with PLUS-RIGHT-ID2 and
  COMMUTATIVITY-OF-PLUS, and expanding the functions ZEROP, TIMES,
  NUMBERP, and EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.56001384 0.156986492 ]

TIMES-ZERO2 


(PROVE-LEMMA DISTRIBUTIVITY-OF-TIMES-OVER-PLUS
	     (REWRITE)
	     (EQUAL (TIMES X (PLUS Y Z))
		    (PLUS (TIMES X Y) (TIMES X Z))))

     Give the conjecture the name *1.


     We will try to prove it by induction.  Four inductions are
suggested by terms in the conjecture.  They merge into two likely
candidate inductions.  However, only one is unflawed.  We will induct
according to the following scheme:
      (AND (IMPLIES (ZEROP X) (P X Y Z))
	   (IMPLIES (AND (NOT (ZEROP X)) (P (SUB1 X) Y Z))
		    (P X Y Z))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP establish that the measure (COUNT X) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme leads to the following two new goals:

Case 2. (IMPLIES (ZEROP X)
		 (EQUAL (TIMES X (PLUS Y Z))
			(PLUS (TIMES X Y) (TIMES X Z)))),

  which simplifies, unfolding the definitions of ZEROP, EQUAL, TIMES,
  and PLUS, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP X))
		      (EQUAL (TIMES (SUB1 X) (PLUS Y Z))
			     (PLUS (TIMES (SUB1 X) Y)
				   (TIMES (SUB1 X) Z))))
		 (EQUAL (TIMES X (PLUS Y Z))
			(PLUS (TIMES X Y) (TIMES X Z)))).

  This simplifies, applying ASSOCIATIVITY-OF-PLUS and
  COMMUTATIVITY2-OF-PLUS, and expanding the functions ZEROP and TIMES,
  to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.88898519 0.176013183 ]

DISTRIBUTIVITY-OF-TIMES-OVER-PLUS 


(PROVE-LEMMA TIMES-ADD1
	     (REWRITE)
	     (EQUAL (TIMES X (ADD1 Y))
		    (IF (NUMBERP Y)
			(PLUS X (TIMES X Y))
			(FIX X))))
This simplifies, opening up the function FIX, to the following three
new goals:

Case 3. (IMPLIES (AND (NOT (NUMBERP Y)) (NUMBERP X))
		 (EQUAL (TIMES X (ADD1 Y)) X)),

  which again simplifies, applying the lemma SUB1-TYPE-RESTRICTION,
  to:

        (IMPLIES (AND (NOT (NUMBERP Y)) (NUMBERP X))
		 (EQUAL (TIMES X 1) X)).

  Call the above conjecture *1.

Case 2. (IMPLIES (AND (NOT (NUMBERP Y))
		      (NOT (NUMBERP X)))
		 (EQUAL (TIMES X (ADD1 Y)) 0)).

  But this simplifies again, rewriting with SUB1-TYPE-RESTRICTION,
  and unfolding the definitions of TIMES and EQUAL, to:

        T.

Case 1. (IMPLIES (NUMBERP Y)
		 (EQUAL (TIMES X (ADD1 Y))
			(PLUS X (TIMES X Y)))),

  which we would usually push and work on later by induction.  But if
  we must use induction to prove the input conjecture, we prefer to
  induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us consider:

(EQUAL (TIMES X (ADD1 Y))
       (IF (NUMBERP Y)
	   (PLUS X (TIMES X Y))
	   (FIX X))),

named *1 above.  We will try to prove it by induction.  The recursive
terms in the conjecture suggest three inductions.  However, they
merge into one likely candidate induction.  We will induct according
to the following scheme:
      (AND (IMPLIES (ZEROP X) (P X Y))
	   (IMPLIES (AND (NOT (ZEROP X)) (P (SUB1 X) Y))
		    (P X Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP can be used to prove that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme leads to two new goals:

Case 2. (IMPLIES (ZEROP X)
		 (EQUAL (TIMES X (ADD1 Y))
			(IF (NUMBERP Y)
			    (PLUS X (TIMES X Y))
			    (FIX X)))).

  This simplifies, rewriting with PLUS-RIGHT-ID2 and
  COMMUTATIVITY-OF-PLUS, and expanding ZEROP, EQUAL, TIMES, PLUS, FIX,
  and NUMBERP, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP X))
		      (EQUAL (TIMES (SUB1 X) (ADD1 Y))
			     (IF (NUMBERP Y)
				 (PLUS (SUB1 X) (TIMES (SUB1 X) Y))
				 (FIX (SUB1 X)))))
		 (EQUAL (TIMES X (ADD1 Y))
			(IF (NUMBERP Y)
			    (PLUS X (TIMES X Y))
			    (FIX X)))),

  which we simplify, rewriting with the lemmas SUB1-TYPE-RESTRICTION
  and SUB1-ADD1, and expanding the definitions of ZEROP, FIX, TIMES,
  and PLUS, to two new conjectures:

  Case 1.2.
          (IMPLIES (AND (NOT (EQUAL X 0))
			(NUMBERP X)
			(NOT (NUMBERP Y))
			(EQUAL (TIMES (SUB1 X) (ADD1 Y))
			       (SUB1 X)))
		   (EQUAL (TIMES X 1) X)),

    which we further simplify, rewriting with SUB1-TYPE-RESTRICTION,
    and unfolding the definition of TIMES, to:

          (IMPLIES (AND (NOT (EQUAL X 0))
			(NUMBERP X)
			(NOT (NUMBERP Y))
			(EQUAL (TIMES (SUB1 X) 1) (SUB1 X)))
		   (EQUAL (PLUS 1 (SUB1 X)) X)),

    which we again simplify, using linear arithmetic, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NOT (EQUAL X 0))
			(NUMBERP X)
			(NUMBERP Y)
			(EQUAL (TIMES (SUB1 X) (ADD1 Y))
			       (PLUS (SUB1 X) (TIMES (SUB1 X) Y))))
		   (EQUAL (ADD1 (PLUS Y (TIMES (SUB1 X) (ADD1 Y))))
			  (PLUS X
				(PLUS Y (TIMES (SUB1 X) Y))))).

    But this simplifies again, using linear arithmetic, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 1.47699381 0.430004884 ]

TIMES-ADD1 


(PROVE-LEMMA COMMUTATIVITY-OF-TIMES
	     (REWRITE)
	     (EQUAL (TIMES X Y) (TIMES Y X)))

     Name the conjecture *1.


     Perhaps we can prove it by induction.  The recursive terms in
the conjecture suggest two inductions, both of which are flawed.  We
limit our consideration to the two suggested by the largest number of
nonprimitive recursive functions in the conjecture.  Since both of
these are equally likely, we will choose arbitrarily.  We will induct
according to the following scheme:
      (AND (IMPLIES (ZEROP X) (P X Y))
	   (IMPLIES (AND (NOT (ZEROP X)) (P (SUB1 X) Y))
		    (P X Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP inform us that the measure (COUNT X) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme produces two new formulas:

Case 2. (IMPLIES (ZEROP X)
		 (EQUAL (TIMES X Y) (TIMES Y X))).

  This simplifies, applying the lemma TIMES-ZERO2, and expanding the
  definitions of ZEROP, EQUAL, and TIMES, to the formula:

        (IMPLIES (EQUAL X 0)
		 (EQUAL 0 (TIMES Y 0))),

  which again simplifies, obviously, to the goal:

        (EQUAL 0 (TIMES Y 0)),

  which we will name *1.1.

Case 1. (IMPLIES (AND (NOT (ZEROP X))
		      (EQUAL (TIMES (SUB1 X) Y)
			     (TIMES Y (SUB1 X))))
		 (EQUAL (TIMES X Y) (TIMES Y X))).

  This simplifies, expanding ZEROP and TIMES, to the new conjecture:

        (IMPLIES (AND (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (EQUAL (TIMES (SUB1 X) Y)
			     (TIMES Y (SUB1 X))))
		 (EQUAL (PLUS Y (TIMES Y (SUB1 X)))
			(TIMES Y X))).

  Appealing to the lemma SUB1-ELIM, we now replace X by (ADD1 Z) to
  eliminate (SUB1 X).  We rely upon the type restriction lemma noted
  when SUB1 was introduced to constrain the new variable.  This
  produces:

        (IMPLIES (AND (NUMBERP Z)
		      (NOT (EQUAL (ADD1 Z) 0))
		      (EQUAL (TIMES Z Y) (TIMES Y Z)))
		 (EQUAL (PLUS Y (TIMES Y Z))
			(TIMES Y (ADD1 Z)))).

  This further simplifies, rewriting with TIMES-ADD1, to:

        T.


     So let us turn our attention to:

      (EQUAL 0 (TIMES Y 0)),

which we named *1.1 above.  Perhaps we can prove it by induction.
There is only one plausible induction.  We will induct according to
the following scheme:
      (AND (IMPLIES (ZEROP Y) (P Y))
	   (IMPLIES (AND (NOT (ZEROP Y)) (P (SUB1 Y)))
		    (P Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP establish that the measure (COUNT Y) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme produces two new formulas:

Case 2. (IMPLIES (ZEROP Y)
		 (EQUAL 0 (TIMES Y 0))),

  which we simplify, expanding ZEROP, TIMES, and EQUAL, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP Y))
		      (EQUAL 0 (TIMES (SUB1 Y) 0)))
		 (EQUAL 0 (TIMES Y 0))),

  which we simplify, unfolding the definitions of ZEROP, TIMES, PLUS,
  and EQUAL, to:

        T.


     That finishes the proof of *1.1, which, consequently, finishes
the proof of *1.  Q.E.D.


[ 2.57198894 0.424007162 ]

COMMUTATIVITY-OF-TIMES 


(PROVE-LEMMA COMMUTATIVITY2-OF-TIMES
	     (REWRITE)
	     (EQUAL (TIMES X (TIMES Y Z))
		    (TIMES Y (TIMES X Z))))

     Give the conjecture the name *1.


     Let us appeal to the induction principle.  The recursive terms
in the conjecture suggest four inductions.  They merge into two
likely candidate inductions, both of which are unflawed.  Since both
of these are equally likely, we will choose arbitrarily.  We will
induct according to the following scheme:
      (AND (IMPLIES (ZEROP Y) (P X Y Z))
	   (IMPLIES (AND (NOT (ZEROP Y)) (P X (SUB1 Y) Z))
		    (P X Y Z))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP inform us that the measure (COUNT Y) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme generates two new conjectures:

Case 2. (IMPLIES (ZEROP Y)
		 (EQUAL (TIMES X (TIMES Y Z))
			(TIMES Y (TIMES X Z)))),

  which simplifies, applying the lemma COMMUTATIVITY-OF-TIMES, and
  unfolding ZEROP, EQUAL, and TIMES, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP Y))
		      (EQUAL (TIMES X (TIMES (SUB1 Y) Z))
			     (TIMES (SUB1 Y) (TIMES X Z))))
		 (EQUAL (TIMES X (TIMES Y Z))
			(TIMES Y (TIMES X Z)))),

  which simplifies, applying DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, and
  expanding the definitions of ZEROP and TIMES, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.948999025 0.177998861 ]

COMMUTATIVITY2-OF-TIMES 


(PROVE-LEMMA ASSOCIATIVITY-OF-TIMES
	     (REWRITE)
	     (EQUAL (TIMES (TIMES X Y) Z)
		    (TIMES X (TIMES Y Z))))
This formula simplifies, rewriting with COMMUTATIVITY-OF-TIMES and
COMMUTATIVITY2-OF-TIMES, to:

      T.

Q.E.D.


[ 0.32799479 0.0180013021 ]

ASSOCIATIVITY-OF-TIMES 


(PROVE-LEMMA EQUAL-TIMES-0
	     (REWRITE)
	     (EQUAL (EQUAL (TIMES X Y) 0.)
		    (OR (ZEROP X) (ZEROP Y))))
This simplifies, unfolding the functions ZEROP and OR, to five new
conjectures:

Case 5. (IMPLIES (NOT (EQUAL (TIMES X Y) 0))
		 (NUMBERP Y)).

  However this again simplifies, applying the lemma TIMES-ZERO2, and
  unfolding EQUAL, to:

        T.

Case 4. (IMPLIES (NOT (EQUAL (TIMES X Y) 0))
		 (NOT (EQUAL Y 0))),

  which again simplifies, applying COMMUTATIVITY-OF-TIMES, and
  expanding the definitions of EQUAL and TIMES, to:

        T.

Case 3. (IMPLIES (NOT (EQUAL (TIMES X Y) 0))
		 (NUMBERP X)),

  which again simplifies, unfolding the functions TIMES and EQUAL, to:

        T.

Case 2. (IMPLIES (NOT (EQUAL (TIMES X Y) 0))
		 (NOT (EQUAL X 0))).

  However this again simplifies, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (AND (EQUAL (TIMES X Y) 0)
		      (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL Y 0)))
		 (NOT (NUMBERP Y))).

  Give the above formula the name *1.


     Let us appeal to the induction principle.  There is only one
suggested induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (ZEROP X) (P Y X))
	   (IMPLIES (AND (NOT (ZEROP X)) (P Y (SUB1 X)))
		    (P Y X))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP can be used to show that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme leads to three new
formulas:

Case 3. (IMPLIES (AND (ZEROP X)
		      (EQUAL (TIMES X Y) 0)
		      (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL Y 0)))
		 (NOT (NUMBERP Y))),

  which simplifies, expanding the definition of ZEROP, to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP X))
		      (NOT (EQUAL (TIMES (SUB1 X) Y) 0))
		      (EQUAL (TIMES X Y) 0)
		      (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL Y 0)))
		 (NOT (NUMBERP Y))),

  which we simplify, rewriting with PLUS-EQUAL-0, and unfolding the
  definitions of ZEROP and TIMES, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP X))
		      (EQUAL (SUB1 X) 0)
		      (EQUAL (TIMES X Y) 0)
		      (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL Y 0)))
		 (NOT (NUMBERP Y))).

  This simplifies, applying PLUS-EQUAL-0, and expanding the functions
  ZEROP and TIMES, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.74699707 0.31500244 ]

EQUAL-TIMES-0 


(ADD-SHELL PUSH NIL STACKP
	   ((TOP (NONE-OF) ZERO)
	    (POP (NONE-OF) ZERO)))

[ 0.451000977 0.0 ]

PUSH 


(DCL CALL (FN X Y))

[ 5.0008138E-3 0.0 ]

CALL 


(DCL GETVALUE (VAR ENVRN))

[ 6.00179034E-3 0.0 ]

GETVALUE 


(ADD-AXIOM NUMBERP-CALL
	   (REWRITE)
	   (NUMBERP (CALL FN X Y)))

[ 0.0240030924 0.0 ]

NUMBERP-CALL 


(DEFN EXPRESSIONP
      (X)
      (IF (LISTP X)
	  (IF (LISTP (CAR X))
	      F
	      (IF (LISTP (CDR X))
		  (IF (LISTP (CDDR X))
		      (IF (EXPRESSIONP (CADR X))
			  (EXPRESSIONP (CADDR X))
			  F)
		      F)
		  F))
	  T))
     Linear arithmetic and the lemmas CAR-LESSP, CDR-LESSEQP, and
CDR-LESSP inform us that the measure (COUNT X) decreases according to
the well-founded relation LESSP in each recursive call.  Hence,
EXPRESSIONP is accepted under the principle of definition.  From the
definition we can conclude that:
      (OR (FALSEP (EXPRESSIONP X))
	  (TRUEP (EXPRESSIONP X)))
is a theorem.




[ 0.30299886 0.057002767 ]

EXPRESSIONP 


(PROVE-LEMMA CADR-CROCK
	     (REWRITE)
	     (IMPLIES (LISTP (CDDR X))
		      (LESSP (COUNT (CADR X)) (COUNT X))))
This simplifies, using linear arithmetic and rewriting with
CDR-LESSEQP and CAR-LESSEQP, to the new conjecture:

      (IMPLIES (AND (EQUAL (COUNT (CDR X)) (COUNT X))
		    (LISTP (CDDR X)))
	       (LESSP (COUNT (CADR X)) (COUNT X))).

Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS V Z)
to eliminate (CDR X) and (CAR X) and Z by (CONS D W) to eliminate
(CDR Z) and (CAR Z).  This generates three new conjectures:

Case 3. (IMPLIES (AND (NOT (LISTP X))
		      (EQUAL (COUNT (CDR X)) (COUNT X))
		      (LISTP (CDDR X)))
		 (LESSP (COUNT (CADR X)) (COUNT X))).

  However this simplifies further, applying the lemma CDR-NLISTP, and
  expanding the definitions of COUNT, CDR, and LISTP, to:

        T.

Case 2. (IMPLIES (AND (NOT (LISTP Z))
		      (EQUAL (COUNT Z) (COUNT (CONS V Z)))
		      (LISTP (CDR Z)))
		 (LESSP (COUNT (CAR Z))
			(COUNT (CONS V Z)))),

  which further simplifies, rewriting with COUNT-CONS and CDR-NLISTP,
  and opening up LISTP, to:

        T.

Case 1. (IMPLIES (AND (EQUAL (COUNT (CONS D W))
			     (COUNT (CONS V (CONS D W))))
		      (LISTP W))
		 (LESSP (COUNT D)
			(COUNT (CONS V (CONS D W))))),

  which further simplifies, appealing to the lemmas COUNT-CONS,
  COMMUTATIVITY2-OF-PLUS, PLUS-ADD1, ADD1-EQUAL, and SUB1-ADD1, and
  unfolding the definition of LESSP, to:

        (IMPLIES (AND (EQUAL (PLUS (COUNT D) (COUNT W))
			     (ADD1 (PLUS (COUNT D)
					 (PLUS (COUNT V) (COUNT W)))))
		      (LISTP W)
		      (NOT (EQUAL (COUNT D) 0)))
		 (LESSP (SUB1 (COUNT D))
			(PLUS (COUNT D) (COUNT W)))),

  which we again simplify, using linear arithmetic, to:

        T.

Q.E.D.


[ 1.89899495 0.211002605 ]

CADR-CROCK 


(DEFN EVAL
      (FORM ENVRN)
      (IF (NUMBERP FORM)
	  FORM
	  (IF (LISTP (CDDR FORM))
	      (CALL (CAR FORM)
		    (EVAL (CADR FORM) ENVRN)
		    (EVAL (CADDR FORM) ENVRN))
	      (GETVALUE FORM ENVRN))))
     Linear arithmetic and the lemmas CAR-LESSP, CDR-LESSEQP, and
CADR-CROCK inform us that the measure (COUNT FORM) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, EVAL is accepted under the principle of definition.




[ 0.20900472 0.0369995115 ]

EVAL 


(DEFN OPTIMIZE
      (FORM)
      (IF (LISTP (CDDR FORM))
	  (IF (NUMBERP (OPTIMIZE (CADR FORM)))
	      (IF (NUMBERP (OPTIMIZE (CADDR FORM)))
		  (CALL (CAR FORM)
			(OPTIMIZE (CADR FORM))
			(OPTIMIZE (CADDR FORM)))
		  (LIST (CAR FORM)
			(OPTIMIZE (CADR FORM))
			(OPTIMIZE (CADDR FORM))))
	      (LIST (CAR FORM)
		    (OPTIMIZE (CADR FORM))
		    (OPTIMIZE (CADDR FORM))))
	  FORM))
     Linear arithmetic and the lemmas CADR-CROCK, CAR-LESSP, and
CDR-LESSEQP establish that the measure (COUNT FORM) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, OPTIMIZE is accepted under the principle of definition.  Note
that:
      (OR (OR (NUMBERP (OPTIMIZE FORM))
	      (LISTP (OPTIMIZE FORM)))
	  (EQUAL (OPTIMIZE FORM) FORM))
is a theorem.




[ 1.40999755 0.051997884 ]

OPTIMIZE 


(DEFN CODEGEN
      (FORM INS)
      (IF (NUMBERP FORM)
	  (CONS (LIST 'PUSHI FORM) INS)
	  (IF (LISTP (CDDR FORM))
	      (CONS (CAR FORM)
		    (CODEGEN (CADDR FORM)
			     (CODEGEN (CADR FORM) INS)))
	      (CONS (LIST 'PUSHV FORM) INS))))
     Linear arithmetic and the lemmas CAR-LESSP, CDR-LESSEQP, and
CADR-CROCK establish that the measure (COUNT FORM) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, CODEGEN is accepted under the principle of definition.
Observe that (LISTP (CODEGEN FORM INS)) is a theorem.




[ 0.25600179 0.042997233 ]

CODEGEN 


(DEFN COMPILE
      (FORM)
      (REVERSE (CODEGEN (OPTIMIZE FORM) NIL)))
     Note that (OR (LITATOM (COMPILE FORM)) (LISTP (COMPILE FORM)))
is a theorem.




[ 0.0300008138 0.0119954427 ]

COMPILE 


(PROVE-LEMMA FORMP-OPTIMIZE
	     (REWRITE)
	     (IMPLIES (EXPRESSIONP X)
		      (EXPRESSIONP (OPTIMIZE X))))

     Name the conjecture *1.


     Perhaps we can prove it by induction.  The recursive terms in
the conjecture suggest two inductions.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (LISTP X) (LISTP (CAR X)))
		    (P X))
	   (IMPLIES (AND (LISTP X)
			 (NOT (LISTP (CAR X)))
			 (LISTP (CDR X))
			 (LISTP (CDDR X))
			 (EXPRESSIONP (CADR X))
			 (P (CADDR X))
			 (P (CADR X)))
		    (P X))
	   (IMPLIES (AND (LISTP X)
			 (NOT (LISTP (CAR X)))
			 (LISTP (CDR X))
			 (LISTP (CDDR X))
			 (NOT (EXPRESSIONP (CADR X)))
			 (P (CADR X)))
		    (P X))
	   (IMPLIES (AND (LISTP X)
			 (NOT (LISTP (CAR X)))
			 (LISTP (CDR X))
			 (NOT (LISTP (CDDR X))))
		    (P X))
	   (IMPLIES (AND (LISTP X)
			 (NOT (LISTP (CAR X)))
			 (NOT (LISTP (CDR X))))
		    (P X))
	   (IMPLIES (NOT (LISTP X)) (P X))).
Linear arithmetic and the lemmas CAR-LESSP, CDR-LESSEQP, and
CDR-LESSP inform us that the measure (COUNT X) decreases according to
the well-founded relation LESSP in each induction step of the scheme.
The above induction scheme produces seven new formulas:

Case 7. (IMPLIES (AND (LISTP X)
		      (LISTP (CAR X))
		      (EXPRESSIONP X))
		 (EXPRESSIONP (OPTIMIZE X))).

  This simplifies, opening up the definition of EXPRESSIONP, to:

        T.

Case 6. (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CAR X)))
		      (LISTP (CDR X))
		      (LISTP (CDDR X))
		      (EXPRESSIONP (CADR X))
		      (NOT (EXPRESSIONP (CADDR X)))
		      (EXPRESSIONP (OPTIMIZE (CADR X)))
		      (EXPRESSIONP X))
		 (EXPRESSIONP (OPTIMIZE X))),

  which we simplify, opening up EXPRESSIONP, to:

        T.

Case 5. (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CAR X)))
		      (LISTP (CDR X))
		      (LISTP (CDDR X))
		      (EXPRESSIONP (CADR X))
		      (EXPRESSIONP (OPTIMIZE (CADDR X)))
		      (EXPRESSIONP (OPTIMIZE (CADR X)))
		      (EXPRESSIONP X))
		 (EXPRESSIONP (OPTIMIZE X))),

  which we simplify, unfolding EXPRESSIONP and OPTIMIZE, to the
  following three new goals:

  Case 5.3.
          (IMPLIES (AND (LISTP X)
			(NOT (LISTP (CAR X)))
			(LISTP (CDR X))
			(LISTP (CDDR X))
			(EXPRESSIONP (CADR X))
			(EXPRESSIONP (OPTIMIZE (CADDR X)))
			(EXPRESSIONP (OPTIMIZE (CADR X)))
			(EXPRESSIONP (CADDR X))
			(NOT (NUMBERP (OPTIMIZE (CADDR X)))))
		   (EXPRESSIONP (LIST (CAR X)
				      (OPTIMIZE (CADR X))
				      (OPTIMIZE (CADDR X))))).

    However this again simplifies, rewriting with CDR-CONS and
    CAR-CONS, and expanding EXPRESSIONP, to:

          T.

  Case 5.2.
          (IMPLIES (AND (LISTP X)
			(NOT (LISTP (CAR X)))
			(LISTP (CDR X))
			(LISTP (CDDR X))
			(EXPRESSIONP (CADR X))
			(EXPRESSIONP (OPTIMIZE (CADDR X)))
			(EXPRESSIONP (OPTIMIZE (CADR X)))
			(EXPRESSIONP (CADDR X))
			(NOT (NUMBERP (OPTIMIZE (CADR X)))))
		   (EXPRESSIONP (LIST (CAR X)
				      (OPTIMIZE (CADR X))
				      (OPTIMIZE (CADDR X))))),

    which we again simplify, applying CDR-CONS and CAR-CONS, and
    expanding the definition of EXPRESSIONP, to:

          T.

  Case 5.1.
          (IMPLIES (AND (LISTP X)
			(NOT (LISTP (CAR X)))
			(LISTP (CDR X))
			(LISTP (CDDR X))
			(EXPRESSIONP (CADR X))
			(EXPRESSIONP (OPTIMIZE (CADDR X)))
			(EXPRESSIONP (OPTIMIZE (CADR X)))
			(EXPRESSIONP (CADDR X))
			(NUMBERP (OPTIMIZE (CADR X)))
			(NUMBERP (OPTIMIZE (CADDR X))))
		   (EXPRESSIONP (CALL (CAR X)
				      (OPTIMIZE (CADR X))
				      (OPTIMIZE (CADDR X))))),

    which we again simplify, unfolding EXPRESSIONP, to:

          T.

Case 4. (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CAR X)))
		      (LISTP (CDR X))
		      (LISTP (CDDR X))
		      (NOT (EXPRESSIONP (CADR X)))
		      (EXPRESSIONP X))
		 (EXPRESSIONP (OPTIMIZE X))).

  This simplifies, expanding EXPRESSIONP, to:

        T.

Case 3. (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CAR X)))
		      (LISTP (CDR X))
		      (NOT (LISTP (CDDR X)))
		      (EXPRESSIONP X))
		 (EXPRESSIONP (OPTIMIZE X))),

  which simplifies, opening up EXPRESSIONP, to:

        T.

Case 2. (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CAR X)))
		      (NOT (LISTP (CDR X)))
		      (EXPRESSIONP X))
		 (EXPRESSIONP (OPTIMIZE X))).

  This simplifies, unfolding EXPRESSIONP, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP X)) (EXPRESSIONP X))
		 (EXPRESSIONP (OPTIMIZE X))),

  which we simplify, applying CDR-NLISTP, and unfolding EXPRESSIONP,
  OPTIMIZE, CDR, and LISTP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.31798503 0.57101237 ]

FORMP-OPTIMIZE 


(PROVE-LEMMA CORRECTNESS-OF-OPTIMIZE
	     (REWRITE)
	     (IMPLIES (EXPRESSIONP X)
		      (EQUAL (EVAL (OPTIMIZE X) ENVRN)
			     (EVAL X ENVRN))))

     Call the conjecture *1.


     Perhaps we can prove it by induction.  There are three plausible
inductions.  However, they merge into one likely candidate induction.
We will induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP X) (LISTP (CAR X)))
		    (P X ENVRN))
	   (IMPLIES (AND (LISTP X)
			 (NOT (LISTP (CAR X)))
			 (LISTP (CDR X))
			 (LISTP (CDDR X))
			 (EXPRESSIONP (CADR X))
			 (P (CADR X) ENVRN)
			 (P (CADDR X) ENVRN))
		    (P X ENVRN))
	   (IMPLIES (AND (LISTP X)
			 (NOT (LISTP (CAR X)))
			 (LISTP (CDR X))
			 (LISTP (CDDR X))
			 (NOT (EXPRESSIONP (CADR X)))
			 (P (CADR X) ENVRN))
		    (P X ENVRN))
	   (IMPLIES (AND (LISTP X)
			 (NOT (LISTP (CAR X)))
			 (LISTP (CDR X))
			 (NOT (LISTP (CDDR X))))
		    (P X ENVRN))
	   (IMPLIES (AND (LISTP X)
			 (NOT (LISTP (CAR X)))
			 (NOT (LISTP (CDR X))))
		    (P X ENVRN))
	   (IMPLIES (NOT (LISTP X))
		    (P X ENVRN))).
Linear arithmetic and the lemmas CAR-LESSP, CDR-LESSEQP, and
CDR-LESSP establish that the measure (COUNT X) decreases according to
the well-founded relation LESSP in each induction step of the scheme.
The above induction scheme generates the following seven new formulas:

Case 7. (IMPLIES (AND (LISTP X)
		      (LISTP (CAR X))
		      (EXPRESSIONP X))
		 (EQUAL (EVAL (OPTIMIZE X) ENVRN)
			(EVAL X ENVRN))).

  This simplifies, expanding EXPRESSIONP, to:

        T.

Case 6. (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CAR X)))
		      (LISTP (CDR X))
		      (LISTP (CDDR X))
		      (EXPRESSIONP (CADR X))
		      (EQUAL (EVAL (OPTIMIZE (CADR X)) ENVRN)
			     (EVAL (CADR X) ENVRN))
		      (NOT (EXPRESSIONP (CADDR X)))
		      (EXPRESSIONP X))
		 (EQUAL (EVAL (OPTIMIZE X) ENVRN)
			(EVAL X ENVRN))).

  This simplifies, opening up the definition of EXPRESSIONP, to:

        T.

Case 5. (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CAR X)))
		      (LISTP (CDR X))
		      (LISTP (CDDR X))
		      (EXPRESSIONP (CADR X))
		      (EQUAL (EVAL (OPTIMIZE (CADR X)) ENVRN)
			     (EVAL (CADR X) ENVRN))
		      (EQUAL (EVAL (OPTIMIZE (CADDR X)) ENVRN)
			     (EVAL (CADDR X) ENVRN))
		      (EXPRESSIONP X))
		 (EQUAL (EVAL (OPTIMIZE X) ENVRN)
			(EVAL X ENVRN))),

  which we simplify, opening up EXPRESSIONP, OPTIMIZE, and EVAL, to
  three new goals:

  Case 5.3.
          (IMPLIES (AND (LISTP X)
			(NOT (LISTP (CAR X)))
			(LISTP (CDR X))
			(LISTP (CDDR X))
			(EXPRESSIONP (CADR X))
			(EQUAL (EVAL (OPTIMIZE (CADR X)) ENVRN)
			       (EVAL (CADR X) ENVRN))
			(EQUAL (EVAL (OPTIMIZE (CADDR X)) ENVRN)
			       (EVAL (CADDR X) ENVRN))
			(EXPRESSIONP (CADDR X))
			(NOT (NUMBERP (OPTIMIZE (CADDR X)))))
		   (EQUAL (EVAL (LIST (CAR X)
				      (OPTIMIZE (CADR X))
				      (OPTIMIZE (CADDR X)))
				ENVRN)
			  (CALL (CAR X)
				(EVAL (CADR X) ENVRN)
				(EVAL (CADDR X) ENVRN)))).

    However this again simplifies, appealing to the lemmas CAR-CONS
    and CDR-CONS, and unfolding the definition of EVAL, to:

          T.

  Case 5.2.
          (IMPLIES (AND (LISTP X)
			(NOT (LISTP (CAR X)))
			(LISTP (CDR X))
			(LISTP (CDDR X))
			(EXPRESSIONP (CADR X))
			(EQUAL (EVAL (OPTIMIZE (CADR X)) ENVRN)
			       (EVAL (CADR X) ENVRN))
			(EQUAL (EVAL (OPTIMIZE (CADDR X)) ENVRN)
			       (EVAL (CADDR X) ENVRN))
			(EXPRESSIONP (CADDR X))
			(NOT (NUMBERP (OPTIMIZE (CADR X)))))
		   (EQUAL (EVAL (LIST (CAR X)
				      (OPTIMIZE (CADR X))
				      (OPTIMIZE (CADDR X)))
				ENVRN)
			  (CALL (CAR X)
				(EVAL (CADR X) ENVRN)
				(EVAL (CADDR X) ENVRN)))),

    which we again simplify, rewriting with CAR-CONS and CDR-CONS,
    and opening up EVAL, to:

          T.

  Case 5.1.
          (IMPLIES (AND (LISTP X)
			(NOT (LISTP (CAR X)))
			(LISTP (CDR X))
			(LISTP (CDDR X))
			(EXPRESSIONP (CADR X))
			(EQUAL (EVAL (OPTIMIZE (CADR X)) ENVRN)
			       (EVAL (CADR X) ENVRN))
			(EQUAL (EVAL (OPTIMIZE (CADDR X)) ENVRN)
			       (EVAL (CADDR X) ENVRN))
			(EXPRESSIONP (CADDR X))
			(NUMBERP (OPTIMIZE (CADR X)))
			(NUMBERP (OPTIMIZE (CADDR X))))
		   (EQUAL (EVAL (CALL (CAR X)
				      (OPTIMIZE (CADR X))
				      (OPTIMIZE (CADDR X)))
				ENVRN)
			  (CALL (CAR X)
				(EVAL (CADR X) ENVRN)
				(EVAL (CADDR X) ENVRN)))),

    which again simplifies, expanding the definition of EVAL, to:

          T.

Case 4. (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CAR X)))
		      (LISTP (CDR X))
		      (LISTP (CDDR X))
		      (NOT (EXPRESSIONP (CADR X)))
		      (EXPRESSIONP X))
		 (EQUAL (EVAL (OPTIMIZE X) ENVRN)
			(EVAL X ENVRN))),

  which we simplify, unfolding EXPRESSIONP, to:

        T.

Case 3. (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CAR X)))
		      (LISTP (CDR X))
		      (NOT (LISTP (CDDR X)))
		      (EXPRESSIONP X))
		 (EQUAL (EVAL (OPTIMIZE X) ENVRN)
			(EVAL X ENVRN))),

  which simplifies, unfolding the definition of EXPRESSIONP, to:

        T.

Case 2. (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CAR X)))
		      (NOT (LISTP (CDR X)))
		      (EXPRESSIONP X))
		 (EQUAL (EVAL (OPTIMIZE X) ENVRN)
			(EVAL X ENVRN))).

  This simplifies, unfolding the definition of EXPRESSIONP, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP X)) (EXPRESSIONP X))
		 (EQUAL (EVAL (OPTIMIZE X) ENVRN)
			(EVAL X ENVRN))),

  which we simplify, rewriting with CDR-NLISTP, and expanding the
  functions EXPRESSIONP, OPTIMIZE, CDR, LISTP, and EVAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 2.02100018 0.65600179 ]

CORRECTNESS-OF-OPTIMIZE 


(DEFN EXEC
      (PC PDS ENVRN)
      (IF (NLISTP PC)
	  PDS
	  (IF (LISTP (CAR PC))
	      (IF (EQUAL (CAAR PC) 'PUSHI)
		  (EXEC (CDR PC)
			(PUSH (CADAR PC) PDS)
			ENVRN)
		  (EXEC (CDR PC)
			(PUSH (GETVALUE (CADAR PC) ENVRN) PDS)
			ENVRN))
	      (EXEC (CDR PC)
		    (PUSH (CALL (CAR PC)
				(TOP (POP PDS))
				(TOP PDS))
			  (POP (POP PDS)))
		    ENVRN))))
     Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP can be used to prove that the measure (COUNT PC)
decreases according to the well-founded relation LESSP in each
recursive call.  Hence, EXEC is accepted under the principle of
definition.  Observe that:
      (OR (STACKP (EXEC PC PDS ENVRN))
	  (EQUAL (EXEC PC PDS ENVRN) PDS))
is a theorem.




[ 1.84499918 0.053999837 ]

EXEC 


(PROVE-LEMMA SEQUENTIAL-EXECUTION
	     (REWRITE)
	     (EQUAL (EXEC (APPEND X Y) PDS ENVRN)
		    (EXEC Y (EXEC X PDS ENVRN) ENVRN)))

     Give the conjecture the name *1.


     We will try to prove it by induction.  Three inductions are
suggested by terms in the conjecture.  They merge into two likely
candidate inductions.  However, only one is unflawed.  We will induct
according to the following scheme:
      (AND (IMPLIES (AND (LISTP X)
			 (P (CDR X)
			    Y
			    (PUSH (CALL (CAR X)
					(TOP (POP PDS))
					(TOP PDS))
				  (POP (POP PDS)))
			    ENVRN)
			 (P (CDR X)
			    Y
			    (PUSH (GETVALUE (CADAR X) ENVRN) PDS)
			    ENVRN)
			 (P (CDR X)
			    Y
			    (PUSH (CADAR X) PDS)
			    ENVRN))
		    (P X Y PDS ENVRN))
	   (IMPLIES (NOT (LISTP X))
		    (P X Y PDS ENVRN))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  Note, however, the inductive
instances chosen for PDS.  The above induction scheme leads to the
following two new goals:

Case 2. (IMPLIES
	 (AND (LISTP X)
	      (EQUAL (EXEC (APPEND (CDR X) Y)
			   (PUSH (CALL (CAR X)
				       (TOP (POP PDS))
				       (TOP PDS))
				 (POP (POP PDS)))
			   ENVRN)
		     (EXEC Y
			   (EXEC (CDR X)
				 (PUSH (CALL (CAR X)
					     (TOP (POP PDS))
					     (TOP PDS))
				       (POP (POP PDS)))
				 ENVRN)
			   ENVRN))
	      (EQUAL (EXEC (APPEND (CDR X) Y)
			   (PUSH (GETVALUE (CADAR X) ENVRN) PDS)
			   ENVRN)
		     (EXEC Y
			   (EXEC (CDR X)
				 (PUSH (GETVALUE (CADAR X) ENVRN) PDS)
				 ENVRN)
			   ENVRN))
	      (EQUAL (EXEC (APPEND (CDR X) Y)
			   (PUSH (CADAR X) PDS)
			   ENVRN)
		     (EXEC Y
			   (EXEC (CDR X)
				 (PUSH (CADAR X) PDS)
				 ENVRN)
			   ENVRN)))
	 (EQUAL (EXEC (APPEND X Y) PDS ENVRN)
		(EXEC Y (EXEC X PDS ENVRN) ENVRN))),

  which simplifies, rewriting with CDR-CONS and CAR-CONS, and
  expanding the functions APPEND and EXEC, to three new conjectures:

  Case 2.3.
          (IMPLIES
	   (AND
	      (LISTP X)
	      (EQUAL (EXEC (APPEND (CDR X) Y)
			   (PUSH (CALL (CAR X)
				       (TOP (POP PDS))
				       (TOP PDS))
				 (POP (POP PDS)))
			   ENVRN)
		     (EXEC Y
			   (EXEC (CDR X)
				 (PUSH (CALL (CAR X)
					     (TOP (POP PDS))
					     (TOP PDS))
				       (POP (POP PDS)))
				 ENVRN)
			   ENVRN))
	      (EQUAL (EXEC (APPEND (CDR X) Y)
			   (PUSH (GETVALUE (CADAR X) ENVRN) PDS)
			   ENVRN)
		     (EXEC Y
			   (EXEC (CDR X)
				 (PUSH (GETVALUE (CADAR X) ENVRN) PDS)
				 ENVRN)
			   ENVRN))
	      (EQUAL (EXEC (APPEND (CDR X) Y)
			   (PUSH (CADAR X) PDS)
			   ENVRN)
		     (EXEC Y
			   (EXEC (CDR X)
				 (PUSH (CADAR X) PDS)
				 ENVRN)
			   ENVRN))
	      (NOT (LISTP (CAR X))))
	   (EQUAL (EXEC (APPEND (CDR X) Y)
			(PUSH (CALL (CAR X)
				    (TOP (POP PDS))
				    (TOP PDS))
			      (POP (POP PDS)))
			ENVRN)
		  (EXEC Y
			(EXEC (CDR X)
			      (PUSH (CALL (CAR X)
					  (TOP (POP PDS))
					  (TOP PDS))
				    (POP (POP PDS)))
			      ENVRN)
			ENVRN))),

    which we again simplify, obviously, to:

          T.

  Case 2.2.
          (IMPLIES
	   (AND
	      (LISTP X)
	      (EQUAL (EXEC (APPEND (CDR X) Y)
			   (PUSH (CALL (CAR X)
				       (TOP (POP PDS))
				       (TOP PDS))
				 (POP (POP PDS)))
			   ENVRN)
		     (EXEC Y
			   (EXEC (CDR X)
				 (PUSH (CALL (CAR X)
					     (TOP (POP PDS))
					     (TOP PDS))
				       (POP (POP PDS)))
				 ENVRN)
			   ENVRN))
	      (EQUAL (EXEC (APPEND (CDR X) Y)
			   (PUSH (GETVALUE (CADAR X) ENVRN) PDS)
			   ENVRN)
		     (EXEC Y
			   (EXEC (CDR X)
				 (PUSH (GETVALUE (CADAR X) ENVRN) PDS)
				 ENVRN)
			   ENVRN))
	      (EQUAL (EXEC (APPEND (CDR X) Y)
			   (PUSH (CADAR X) PDS)
			   ENVRN)
		     (EXEC Y
			   (EXEC (CDR X)
				 (PUSH (CADAR X) PDS)
				 ENVRN)
			   ENVRN))
	      (LISTP (CAR X))
	      (EQUAL (CAAR X) 'PUSHI))
	   (EQUAL (EXEC (APPEND (CDR X) Y)
			(PUSH (CADAR X) PDS)
			ENVRN)
		  (EXEC Y
			(EXEC (CDR X)
			      (PUSH (CADAR X) PDS)
			      ENVRN)
			ENVRN))),

    which we again simplify, obviously, to:

          T.

  Case 2.1.
          (IMPLIES
	   (AND
	      (LISTP X)
	      (EQUAL (EXEC (APPEND (CDR X) Y)
			   (PUSH (CALL (CAR X)
				       (TOP (POP PDS))
				       (TOP PDS))
				 (POP (POP PDS)))
			   ENVRN)
		     (EXEC Y
			   (EXEC (CDR X)
				 (PUSH (CALL (CAR X)
					     (TOP (POP PDS))
					     (TOP PDS))
				       (POP (POP PDS)))
				 ENVRN)
			   ENVRN))
	      (EQUAL (EXEC (APPEND (CDR X) Y)
			   (PUSH (GETVALUE (CADAR X) ENVRN) PDS)
			   ENVRN)
		     (EXEC Y
			   (EXEC (CDR X)
				 (PUSH (GETVALUE (CADAR X) ENVRN) PDS)
				 ENVRN)
			   ENVRN))
	      (EQUAL (EXEC (APPEND (CDR X) Y)
			   (PUSH (CADAR X) PDS)
			   ENVRN)
		     (EXEC Y
			   (EXEC (CDR X)
				 (PUSH (CADAR X) PDS)
				 ENVRN)
			   ENVRN))
	      (LISTP (CAR X))
	      (NOT (EQUAL (CAAR X) 'PUSHI)))
	   (EQUAL (EXEC (APPEND (CDR X) Y)
			(PUSH (GETVALUE (CADAR X) ENVRN) PDS)
			ENVRN)
		  (EXEC Y
			(EXEC (CDR X)
			      (PUSH (GETVALUE (CADAR X) ENVRN) PDS)
			      ENVRN)
			ENVRN))),

    which again simplifies, trivially, to:

          T.

Case 1. (IMPLIES (NOT (LISTP X))
		 (EQUAL (EXEC (APPEND X Y) PDS ENVRN)
			(EXEC Y (EXEC X PDS ENVRN) ENVRN))).

  This simplifies, expanding APPEND and EXEC, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.46299236 0.533007815 ]

SEQUENTIAL-EXECUTION 


(PROVE-LEMMA CORRECTNESS-OF-CODEGEN
	     (REWRITE)
	     (IMPLIES (EXPRESSIONP X)
		      (EQUAL (EXEC (REVERSE (CODEGEN X INS))
				   PDS ENVRN)
			     (PUSH (EVAL X ENVRN)
				   (EXEC (REVERSE INS) PDS ENVRN)))))

     Give the conjecture the name *1.


     We will try to prove it by induction.  Four inductions are
suggested by terms in the conjecture.  They merge into two likely
candidate inductions.  However, only one is unflawed.  We will induct
according to the following scheme:
      (AND (IMPLIES (AND (LISTP X) (LISTP (CAR X)))
		    (P X INS PDS ENVRN))
	   (IMPLIES (AND (LISTP X)
			 (NOT (LISTP (CAR X)))
			 (LISTP (CDR X))
			 (LISTP (CDDR X))
			 (EXPRESSIONP (CADR X))
			 (P (CADR X) INS PDS ENVRN)
			 (P (CADDR X)
			    (CODEGEN (CADR X) INS)
			    PDS ENVRN))
		    (P X INS PDS ENVRN))
	   (IMPLIES (AND (LISTP X)
			 (NOT (LISTP (CAR X)))
			 (LISTP (CDR X))
			 (LISTP (CDDR X))
			 (NOT (EXPRESSIONP (CADR X)))
			 (P (CADR X) INS PDS ENVRN))
		    (P X INS PDS ENVRN))
	   (IMPLIES (AND (LISTP X)
			 (NOT (LISTP (CAR X)))
			 (LISTP (CDR X))
			 (NOT (LISTP (CDDR X))))
		    (P X INS PDS ENVRN))
	   (IMPLIES (AND (LISTP X)
			 (NOT (LISTP (CAR X)))
			 (NOT (LISTP (CDR X))))
		    (P X INS PDS ENVRN))
	   (IMPLIES (NOT (LISTP X))
		    (P X INS PDS ENVRN))).
Linear arithmetic and the lemmas CAR-LESSP, CDR-LESSEQP, and
CDR-LESSP establish that the measure (COUNT X) decreases according to
the well-founded relation LESSP in each induction step of the scheme.
Note, however, the inductive instances chosen for INS.  The above
induction scheme leads to the following seven new goals:

Case 7. (IMPLIES (AND (LISTP X)
		      (LISTP (CAR X))
		      (EXPRESSIONP X))
		 (EQUAL (EXEC (REVERSE (CODEGEN X INS))
			      PDS ENVRN)
			(PUSH (EVAL X ENVRN)
			      (EXEC (REVERSE INS) PDS ENVRN)))),

  which simplifies, unfolding the definition of EXPRESSIONP, to:

        T.

Case 6. (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CAR X)))
		      (LISTP (CDR X))
		      (LISTP (CDDR X))
		      (EXPRESSIONP (CADR X))
		      (EQUAL (EXEC (REVERSE (CODEGEN (CADR X) INS))
				   PDS ENVRN)
			     (PUSH (EVAL (CADR X) ENVRN)
				   (EXEC (REVERSE INS) PDS ENVRN)))
		      (NOT (EXPRESSIONP (CADDR X)))
		      (EXPRESSIONP X))
		 (EQUAL (EXEC (REVERSE (CODEGEN X INS))
			      PDS ENVRN)
			(PUSH (EVAL X ENVRN)
			      (EXEC (REVERSE INS) PDS ENVRN)))).

  This simplifies, expanding the definition of EXPRESSIONP, to:

        T.

Case 5. (IMPLIES
	  (AND (LISTP X)
	       (NOT (LISTP (CAR X)))
	       (LISTP (CDR X))
	       (LISTP (CDDR X))
	       (EXPRESSIONP (CADR X))
	       (EQUAL (EXEC (REVERSE (CODEGEN (CADR X) INS))
			    PDS ENVRN)
		      (PUSH (EVAL (CADR X) ENVRN)
			    (EXEC (REVERSE INS) PDS ENVRN)))
	       (EQUAL (EXEC (REVERSE (CODEGEN (CADDR X)
					      (CODEGEN (CADR X) INS)))
			    PDS ENVRN)
		      (PUSH (EVAL (CADDR X) ENVRN)
			    (EXEC (REVERSE (CODEGEN (CADR X) INS))
				  PDS ENVRN)))
	       (EXPRESSIONP X))
	  (EQUAL (EXEC (REVERSE (CODEGEN X INS))
		       PDS ENVRN)
		 (PUSH (EVAL X ENVRN)
		       (EXEC (REVERSE INS) PDS ENVRN)))),

  which simplifies, rewriting with CAR-CONS, CDR-CONS,
  SEQUENTIAL-EXECUTION, TOP-PUSH, and PUSH-EQUAL, and opening up
  EXPRESSIONP, CODEGEN, REVERSE, EXEC, LISTP, and EVAL, to two new
  goals:

  Case 5.2.
          (IMPLIES
	   (AND
	       (LISTP X)
	       (NOT (LISTP (CAR X)))
	       (LISTP (CDR X))
	       (LISTP (CDDR X))
	       (EXPRESSIONP (CADR X))
	       (EQUAL (EXEC (REVERSE (CODEGEN (CADR X) INS))
			    PDS ENVRN)
		      (PUSH (EVAL (CADR X) ENVRN)
			    (EXEC (REVERSE INS) PDS ENVRN)))
	       (EQUAL (EXEC (REVERSE (CODEGEN (CADDR X)
					      (CODEGEN (CADR X) INS)))
			    PDS ENVRN)
		      (PUSH (EVAL (CADDR X) ENVRN)
			    (EXEC (REVERSE (CODEGEN (CADR X) INS))
				  PDS ENVRN)))
	       (EXPRESSIONP (CADDR X)))
	   (EQUAL
	    (CALL
	     (CAR X)
	     (TOP
		 (POP (EXEC (REVERSE (CODEGEN (CADDR X)
					      (CODEGEN (CADR X) INS)))
			    PDS ENVRN)))
	     (TOP (EXEC (REVERSE (CODEGEN (CADDR X)
					  (CODEGEN (CADR X) INS)))
			PDS ENVRN)))
	    (CALL (CAR X)
		  (EVAL (CADR X) ENVRN)
		  (EVAL (CADDR X) ENVRN)))).

    Appealing to the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
    eliminate (CAR X) and (CDR X), V by (CONS D W) to eliminate
    (CDR V) and (CAR V), and W by (CONS V C) to eliminate (CAR W) and
    (CDR W).  This produces:

          (IMPLIES
	   (AND (NOT (LISTP Z))
		(EXPRESSIONP D)
		(EQUAL (EXEC (REVERSE (CODEGEN D INS))
			     PDS ENVRN)
		       (PUSH (EVAL D ENVRN)
			     (EXEC (REVERSE INS) PDS ENVRN)))
		(EQUAL (EXEC (REVERSE (CODEGEN V (CODEGEN D INS)))
			     PDS ENVRN)
		       (PUSH (EVAL V ENVRN)
			     (EXEC (REVERSE (CODEGEN D INS))
				   PDS ENVRN)))
		(EXPRESSIONP V))
	   (EQUAL
	    (CALL Z
		 (TOP (POP (EXEC (REVERSE (CODEGEN V (CODEGEN D INS)))
				 PDS ENVRN)))
		 (TOP (EXEC (REVERSE (CODEGEN V (CODEGEN D INS)))
			    PDS ENVRN)))
	    (CALL Z
		  (EVAL D ENVRN)
		  (EVAL V ENVRN)))).

    We now use the first equality hypothesis by substituting:
          (PUSH (EVAL D ENVRN)
		(EXEC (REVERSE INS) PDS ENVRN))
    for (EXEC (REVERSE (CODEGEN D INS)) PDS ENVRN) and throwing away
    the equality.  We would thus like to prove:

          (IMPLIES
	   (AND (NOT (LISTP Z))
		(EXPRESSIONP D)
		(EQUAL (EXEC (REVERSE (CODEGEN V (CODEGEN D INS)))
			     PDS ENVRN)
		       (PUSH (EVAL V ENVRN)
			     (PUSH (EVAL D ENVRN)
				   (EXEC (REVERSE INS) PDS ENVRN))))
		(EXPRESSIONP V))
	   (EQUAL
	    (CALL Z
		 (TOP (POP (EXEC (REVERSE (CODEGEN V (CODEGEN D INS)))
				 PDS ENVRN)))
		 (TOP (EXEC (REVERSE (CODEGEN V (CODEGEN D INS)))
			    PDS ENVRN)))
	    (CALL Z
		  (EVAL D ENVRN)
		  (EVAL V ENVRN)))).

    We use the above equality hypothesis by substituting:
          (PUSH (EVAL V ENVRN)
		(PUSH (EVAL D ENVRN)
		      (EXEC (REVERSE INS) PDS ENVRN)))
    for (EXEC (REVERSE (CODEGEN V (CODEGEN D INS))) PDS ENVRN) and
    throwing away the equality.  This produces:

          (IMPLIES
	   (AND (NOT (LISTP Z))
		(EXPRESSIONP D)
		(EXPRESSIONP V))
	   (EQUAL
	    (CALL Z
	      (TOP (POP (PUSH (EVAL V ENVRN)
			      (PUSH (EVAL D ENVRN)
				    (EXEC (REVERSE INS) PDS ENVRN)))))
	      (TOP (PUSH (EVAL V ENVRN)
			 (PUSH (EVAL D ENVRN)
			       (EXEC (REVERSE INS) PDS ENVRN)))))
	    (CALL Z
		  (EVAL D ENVRN)
		  (EVAL V ENVRN)))).

    This simplifies further, rewriting with the lemmas POP-PUSH and
    TOP-PUSH, to:

          T.

  Case 5.1.
          (IMPLIES
	   (AND
	       (LISTP X)
	       (NOT (LISTP (CAR X)))
	       (LISTP (CDR X))
	       (LISTP (CDDR X))
	       (EXPRESSIONP (CADR X))
	       (EQUAL (EXEC (REVERSE (CODEGEN (CADR X) INS))
			    PDS ENVRN)
		      (PUSH (EVAL (CADR X) ENVRN)
			    (EXEC (REVERSE INS) PDS ENVRN)))
	       (EQUAL (EXEC (REVERSE (CODEGEN (CADDR X)
					      (CODEGEN (CADR X) INS)))
			    PDS ENVRN)
		      (PUSH (EVAL (CADDR X) ENVRN)
			    (EXEC (REVERSE (CODEGEN (CADR X) INS))
				  PDS ENVRN)))
	       (EXPRESSIONP (CADDR X)))
	   (EQUAL
	    (POP (POP (EXEC (REVERSE (CODEGEN (CADDR X)
					      (CODEGEN (CADR X) INS)))
			    PDS ENVRN)))
	    (EXEC (REVERSE INS) PDS ENVRN))).

    Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
    eliminate (CAR X) and (CDR X), V by (CONS D W) to eliminate
    (CDR V) and (CAR V), and W by (CONS V C) to eliminate (CAR W) and
    (CDR W).  We would thus like to prove:

          (IMPLIES
	   (AND (NOT (LISTP Z))
		(EXPRESSIONP D)
		(EQUAL (EXEC (REVERSE (CODEGEN D INS))
			     PDS ENVRN)
		       (PUSH (EVAL D ENVRN)
			     (EXEC (REVERSE INS) PDS ENVRN)))
		(EQUAL (EXEC (REVERSE (CODEGEN V (CODEGEN D INS)))
			     PDS ENVRN)
		       (PUSH (EVAL V ENVRN)
			     (EXEC (REVERSE (CODEGEN D INS))
				   PDS ENVRN)))
		(EXPRESSIONP V))
	   (EQUAL
		 (POP (POP (EXEC (REVERSE (CODEGEN V (CODEGEN D INS)))
				 PDS ENVRN)))
		 (EXEC (REVERSE INS) PDS ENVRN))).

    We now use the first equality hypothesis by substituting:
          (PUSH (EVAL D ENVRN)
		(EXEC (REVERSE INS) PDS ENVRN))
    for (EXEC (REVERSE (CODEGEN D INS)) PDS ENVRN) and throwing away
    the equality.  We would thus like to prove:

          (IMPLIES
	   (AND (NOT (LISTP Z))
		(EXPRESSIONP D)
		(EQUAL (EXEC (REVERSE (CODEGEN V (CODEGEN D INS)))
			     PDS ENVRN)
		       (PUSH (EVAL V ENVRN)
			     (PUSH (EVAL D ENVRN)
				   (EXEC (REVERSE INS) PDS ENVRN))))
		(EXPRESSIONP V))
	   (EQUAL
		 (POP (POP (EXEC (REVERSE (CODEGEN V (CODEGEN D INS)))
				 PDS ENVRN)))
		 (EXEC (REVERSE INS) PDS ENVRN))).

    We use the above equality hypothesis by substituting:
          (PUSH (EVAL V ENVRN)
		(PUSH (EVAL D ENVRN)
		      (EXEC (REVERSE INS) PDS ENVRN)))
    for (EXEC (REVERSE (CODEGEN V (CODEGEN D INS))) PDS ENVRN) and
    throwing away the equality.  This produces:

          (IMPLIES
	   (AND (NOT (LISTP Z))
		(EXPRESSIONP D)
		(EXPRESSIONP V))
	   (EQUAL
	      (POP (POP (PUSH (EVAL V ENVRN)
			      (PUSH (EVAL D ENVRN)
				    (EXEC (REVERSE INS) PDS ENVRN)))))
	      (EXEC (REVERSE INS) PDS ENVRN))),

    which we further simplify, rewriting with POP-PUSH, to:

          T.

Case 4. (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CAR X)))
		      (LISTP (CDR X))
		      (LISTP (CDDR X))
		      (NOT (EXPRESSIONP (CADR X)))
		      (EXPRESSIONP X))
		 (EQUAL (EXEC (REVERSE (CODEGEN X INS))
			      PDS ENVRN)
			(PUSH (EVAL X ENVRN)
			      (EXEC (REVERSE INS) PDS ENVRN)))),

  which we simplify, expanding EXPRESSIONP, to:

        T.

Case 3. (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CAR X)))
		      (LISTP (CDR X))
		      (NOT (LISTP (CDDR X)))
		      (EXPRESSIONP X))
		 (EQUAL (EXEC (REVERSE (CODEGEN X INS))
			      PDS ENVRN)
			(PUSH (EVAL X ENVRN)
			      (EXEC (REVERSE INS) PDS ENVRN)))),

  which we simplify, unfolding the definition of EXPRESSIONP, to:

        T.

Case 2. (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CAR X)))
		      (NOT (LISTP (CDR X)))
		      (EXPRESSIONP X))
		 (EQUAL (EXEC (REVERSE (CODEGEN X INS))
			      PDS ENVRN)
			(PUSH (EVAL X ENVRN)
			      (EXEC (REVERSE INS) PDS ENVRN)))),

  which simplifies, unfolding the definition of EXPRESSIONP, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP X)) (EXPRESSIONP X))
		 (EQUAL (EXEC (REVERSE (CODEGEN X INS))
			      PDS ENVRN)
			(PUSH (EVAL X ENVRN)
			      (EXEC (REVERSE INS) PDS ENVRN)))),

  which simplifies, applying CDR-NLISTP, and opening up the functions
  EXPRESSIONP, CODEGEN, CDR, LISTP, and EVAL, to the following two
  new conjectures:

  Case 1.2.
          (IMPLIES (AND (NOT (LISTP X))
			(NOT (NUMBERP X)))
		   (EQUAL (EXEC (REVERSE (CONS (LIST 'PUSHV X) INS))
				PDS ENVRN)
			  (PUSH (GETVALUE X ENVRN)
				(EXEC (REVERSE INS) PDS ENVRN)))),

    which again simplifies, applying CAR-CONS, CDR-CONS, and
    SEQUENTIAL-EXECUTION, and opening up the definitions of REVERSE,
    EQUAL, EXEC, and LISTP, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NOT (LISTP X)) (NUMBERP X))
		   (EQUAL (EXEC (REVERSE (CONS (LIST 'PUSHI X) INS))
				PDS ENVRN)
			  (PUSH X
				(EXEC (REVERSE INS) PDS ENVRN)))),

    which we again simplify, applying CAR-CONS, CDR-CONS, and
    SEQUENTIAL-EXECUTION, and opening up the functions REVERSE, EQUAL,
    EXEC, and LISTP, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 13.8529907 1.20301107 ]

CORRECTNESS-OF-CODEGEN 


(PROVE-LEMMA CORRECTNESS-OF-OPTIMIZING-COMPILER NIL
	     (IMPLIES (EXPRESSIONP X)
		      (EQUAL (EXEC (COMPILE X) PDS ENVRN)
			     (PUSH (EVAL X ENVRN) PDS))))
This formula can be simplified, using the abbreviations IMPLIES and
COMPILE, to:

      (IMPLIES (EXPRESSIONP X)
	       (EQUAL (EXEC (REVERSE (CODEGEN (OPTIMIZE X) NIL))
			    PDS ENVRN)
		      (PUSH (EVAL X ENVRN) PDS))),

which simplifies, applying the lemmas FORMP-OPTIMIZE,
CORRECTNESS-OF-OPTIMIZE, and CORRECTNESS-OF-CODEGEN, and unfolding
REVERSE, LISTP, and EXEC, to:

      T.

Q.E.D.


[ 0.271004234 0.0489990236 ]

CORRECTNESS-OF-OPTIMIZING-COMPILER 


(PROVE-LEMMA TRANSITIVITY-OF-LESSP NIL
	     (IMPLIES (AND (LESSP X Y) (LESSP Y Z))
		      (LESSP X Z)))
This formula simplifies, using linear arithmetic, to:

      T.

Q.E.D.


[ 0.81400553 0.0139973959 ]

TRANSITIVITY-OF-LESSP 


(PROVE-LEMMA LESSP-NOT-REFLEXIVE NIL
	     ( LEQ X X))
This simplifies, using linear arithmetic, to:

      T.

Q.E.D.


[ 0.017997233 0.0140014648 ]

LESSP-NOT-REFLEXIVE 


(DEFN EQP
      (X Y)
      (EQUAL (FIX X) (FIX Y)))
     Observe that (OR (FALSEP (EQP X Y)) (TRUEP (EQP X Y))) is a
theorem.




[ 0.038000488 0.0119995117 ]

EQP 


(PROVE-LEMMA TRICHOTOMY-OF-LESSP NIL
	     (IMPLIES (AND (NOT (EQP X Y)) ( LEQ X Y))
		      (LESSP X Y)))
This conjecture simplifies, using linear arithmetic, to three new
conjectures:

Case 3. (IMPLIES (AND (NOT (NUMBERP Y))
		      (NOT (EQP X Y))
		      ( LEQ X Y))
		 (LESSP X Y)),

  which again simplifies, opening up the definitions of EQP and LESSP,
  to:

        T.

Case 2. (IMPLIES (AND (NOT (NUMBERP X))
		      (NOT (EQP X Y))
		      ( LEQ X Y))
		 (LESSP X Y)).

  However this simplifies again, opening up the definitions of EQP
  and LESSP, to:

        T.

Case 1. (IMPLIES (AND (NUMBERP X)
		      (NUMBERP Y)
		      (NOT (EQP X X))
		      ( LEQ X X))
		 (LESSP X X)),

  which we again simplify, opening up EQP, to:

        T.

Q.E.D.


[ 0.169006348 0.088993327 ]

TRICHOTOMY-OF-LESSP 


(PROVE-LEMMA REVERSE-REVERSE
	     (REWRITE)
	     (IMPLIES (PLISTP X)
		      (EQUAL (REVERSE (REVERSE X)) X)))

     Give the conjecture the name *1.


     We will try to prove it by induction.  Two inductions are
suggested by terms in the conjecture.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (LISTP X) (P (CDR X)))
		    (P X))
	   (IMPLIES (NOT (LISTP X)) (P X))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme leads
to the following three new goals:

Case 3. (IMPLIES (AND (LISTP X)
		      (NOT (PLISTP (CDR X)))
		      (PLISTP X))
		 (EQUAL (REVERSE (REVERSE X)) X)),

  which we simplify, expanding PLISTP, to:

        T.

Case 2. (IMPLIES (AND (LISTP X)
		      (EQUAL (REVERSE (REVERSE (CDR X)))
			     (CDR X))
		      (PLISTP X))
		 (EQUAL (REVERSE (REVERSE X)) X)).

  This simplifies, applying CAR-CONS, CDR-CONS, CONS-CAR-CDR, and
  APPEND-REVERSE, and unfolding PLISTP, REVERSE, APPEND, and LISTP,
  to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP X)) (PLISTP X))
		 (EQUAL (REVERSE (REVERSE X)) X)),

  which simplifies, expanding the definitions of PLISTP, REVERSE, and
  EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.302990723 0.183007812 ]

REVERSE-REVERSE 


(DEFN FLATTEN
      (X)
      (IF (LISTP X)
	  (APPEND (FLATTEN (CAR X))
		  (FLATTEN (CDR X)))
	  (CONS X NIL)))
     Linear arithmetic and the lemmas CDR-LESSP and CAR-LESSP inform
us that the measure (COUNT X) decreases according to the well-founded
relation LESSP in each recursive call.  Hence, FLATTEN is accepted
under the principle of definition.  From the definition we can
conclude that (LISTP (FLATTEN X)) is a theorem.




[ 0.112996419 0.0449991864 ]

FLATTEN 


(DEFN MC-FLATTEN
      (X Y)
      (IF (LISTP X)
	  (MC-FLATTEN (CAR X)
		      (MC-FLATTEN (CDR X) Y))
	  (CONS X Y)))
     Linear arithmetic and the lemmas CAR-LESSP and CDR-LESSP inform
us that the measure (COUNT X) decreases according to the well-founded
relation LESSP in each recursive call.  Hence, MC-FLATTEN is accepted
under the principle of definition.  From the definition we can
conclude that (LISTP (MC-FLATTEN X Y)) is a theorem.




[ 0.111999512 0.0440022787 ]

MC-FLATTEN 


(PROVE-LEMMA FLATTEN-MC-FLATTEN
	     (REWRITE)
	     (EQUAL (MC-FLATTEN X Y)
		    (APPEND (FLATTEN X) Y)))

     Call the conjecture *1.


     Perhaps we can prove it by induction.  There are two plausible
inductions.  However, they merge into one likely candidate induction.
We will induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP X)
			 (P (CAR X) (MC-FLATTEN (CDR X) Y))
			 (P (CDR X) Y))
		    (P X Y))
	   (IMPLIES (NOT (LISTP X)) (P X Y))).
Linear arithmetic and the lemmas CAR-LESSP and CDR-LESSP establish
that the measure (COUNT X) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  Note, however,
the inductive instances chosen for Y.  The above induction scheme
produces two new formulas:

Case 2. (IMPLIES (AND (LISTP X)
		      (EQUAL (MC-FLATTEN (CAR X)
					 (MC-FLATTEN (CDR X) Y))
			     (APPEND (FLATTEN (CAR X))
				     (MC-FLATTEN (CDR X) Y)))
		      (EQUAL (MC-FLATTEN (CDR X) Y)
			     (APPEND (FLATTEN (CDR X)) Y)))
		 (EQUAL (MC-FLATTEN X Y)
			(APPEND (FLATTEN X) Y))).

  This simplifies, applying ASSOCIATIVITY-OF-APPEND, and expanding
  MC-FLATTEN and FLATTEN, to:

        T.

Case 1. (IMPLIES (NOT (LISTP X))
		 (EQUAL (MC-FLATTEN X Y)
			(APPEND (FLATTEN X) Y))).

  This simplifies, applying CDR-CONS and CAR-CONS, and unfolding
  MC-FLATTEN, FLATTEN, APPEND, and LISTP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.291007485 0.180993652 ]

FLATTEN-MC-FLATTEN 


(PROVE-LEMMA MEMBER-APPEND
	     (REWRITE)
	     (EQUAL (MEMBER X (APPEND A B))
		    (OR (MEMBER X A) (MEMBER X B))))
This formula simplifies, expanding the definition of OR, to the
following two new formulas:

Case 2. (IMPLIES (NOT (MEMBER X A))
		 (EQUAL (MEMBER X (APPEND A B))
			(MEMBER X B))).

  Give the above formula the name *1.

Case 1. (IMPLIES (MEMBER X A)
		 (EQUAL (MEMBER X (APPEND A B)) T)),

  which again simplifies, obviously, to:

        (IMPLIES (MEMBER X A)
		 (MEMBER X (APPEND A B))),

  which we would usually push and work on later by induction.  But if
  we must use induction to prove the input conjecture, we prefer to
  induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us consider:

(EQUAL (MEMBER X (APPEND A B))
       (OR (MEMBER X A) (MEMBER X B))),

named *1 above.  We will try to prove it by induction.  The recursive
terms in the conjecture suggest three inductions.  They merge into
two likely candidate inductions.  However, only one is unflawed.  We
will induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP A) (P X (CDR A) B))
		    (P X A B))
	   (IMPLIES (NOT (LISTP A)) (P X A B))).
Linear arithmetic and the lemma CDR-LESSP can be used to prove that
the measure (COUNT A) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme leads to two new goals:

Case 2. (IMPLIES (AND (LISTP A)
		      (EQUAL (MEMBER X (APPEND (CDR A) B))
			     (OR (MEMBER X (CDR A)) (MEMBER X B))))
		 (EQUAL (MEMBER X (APPEND A B))
			(OR (MEMBER X A) (MEMBER X B)))).

  This simplifies, rewriting with CDR-CONS and CAR-CONS, and
  expanding OR, APPEND, MEMBER, and EQUAL, to:

        T.

Case 1. (IMPLIES (NOT (LISTP A))
		 (EQUAL (MEMBER X (APPEND A B))
			(OR (MEMBER X A) (MEMBER X B)))),

  which we simplify, opening up APPEND, MEMBER, and OR, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.82899577 0.273010254 ]

MEMBER-APPEND 


(PROVE-LEMMA MEMBER-REVERSE
	     (REWRITE)
	     (EQUAL (MEMBER X (REVERSE Y))
		    (MEMBER X Y)))

     Call the conjecture *1.


     Perhaps we can prove it by induction.  There are two plausible
inductions.  However, they merge into one likely candidate induction.
We will induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP Y) (P X (CDR Y)))
		    (P X Y))
	   (IMPLIES (NOT (LISTP Y)) (P X Y))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
produces two new formulas:

Case 2. (IMPLIES (AND (LISTP Y)
		      (EQUAL (MEMBER X (REVERSE (CDR Y)))
			     (MEMBER X (CDR Y))))
		 (EQUAL (MEMBER X (REVERSE Y))
			(MEMBER X Y))).

  This simplifies, applying CDR-CONS, CAR-CONS, and MEMBER-APPEND,
  and expanding REVERSE, MEMBER, and LISTP, to the following three
  new goals:

  Case 2.3.
          (IMPLIES (AND (LISTP Y)
			(EQUAL (MEMBER X (REVERSE (CDR Y)))
			       (MEMBER X (CDR Y)))
			(NOT (EQUAL X (CAR Y)))
			(NOT (MEMBER X (CDR Y))))
		   (EQUAL (EQUAL X (CAR Y))
			  (MEMBER X (CDR Y)))),

    which again simplifies, obviously, to:

          T.

  Case 2.2.
          (IMPLIES (AND (LISTP Y)
			(EQUAL (MEMBER X (REVERSE (CDR Y)))
			       (MEMBER X (CDR Y)))
			(NOT (EQUAL X (CAR Y)))
			(MEMBER X (CDR Y)))
		   (EQUAL T (MEMBER X (CDR Y)))),

    which again simplifies, clearly, to:

          T.

  Case 2.1.
          (IMPLIES (AND (LISTP Y)
			(EQUAL (MEMBER X (REVERSE (CDR Y)))
			       (MEMBER X (CDR Y)))
			(EQUAL X (CAR Y))
			(NOT (MEMBER X (CDR Y))))
		   (EQUAL (EQUAL X (CAR Y)) T)),

    which we again simplify, opening up EQUAL, to:

          T.

Case 1. (IMPLIES (NOT (LISTP Y))
		 (EQUAL (MEMBER X (REVERSE Y))
			(MEMBER X Y))),

  which we simplify, unfolding REVERSE, LISTP, MEMBER, and EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.49300944 0.245992025 ]

MEMBER-REVERSE 


(PROVE-LEMMA LENGTH-REVERSE
	     (REWRITE)
	     (EQUAL (LENGTH (REVERSE X))
		    (LENGTH X)))

     Name the conjecture *1.


     Perhaps we can prove it by induction.  The recursive terms in
the conjecture suggest two inductions.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (LISTP X) (P (CDR X)))
		    (P X))
	   (IMPLIES (NOT (LISTP X)) (P X))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
produces two new formulas:

Case 2. (IMPLIES (AND (LISTP X)
		      (EQUAL (LENGTH (REVERSE (CDR X)))
			     (LENGTH (CDR X))))
		 (EQUAL (LENGTH (REVERSE X))
			(LENGTH X))).

  This simplifies, opening up the definitions of REVERSE and LENGTH,
  to:

        (IMPLIES (AND (LISTP X)
		      (EQUAL (LENGTH (REVERSE (CDR X)))
			     (LENGTH (CDR X))))
		 (EQUAL (LENGTH (APPEND (REVERSE (CDR X))
					(LIST (CAR X))))
			(ADD1 (LENGTH (CDR X))))).

  Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS V Z) to
  eliminate (CDR X) and (CAR X).  We must thus prove:

        (IMPLIES (EQUAL (LENGTH (REVERSE Z))
			(LENGTH Z))
		 (EQUAL (LENGTH (APPEND (REVERSE Z) (LIST V)))
			(ADD1 (LENGTH Z)))).

  We use the above equality hypothesis by substituting
  (LENGTH (REVERSE Z)) for (LENGTH Z) and throwing away the equality.
  We must thus prove:

        (EQUAL (LENGTH (APPEND (REVERSE Z) (LIST V)))
	       (ADD1 (LENGTH (REVERSE Z)))).

  We will try to prove the above conjecture by generalizing it,
  replacing (REVERSE Z) by Y.  We restrict the new variable by
  recalling PLISTP-REVERSE.  This produces:

        (IMPLIES (PLISTP Y)
		 (EQUAL (LENGTH (APPEND Y (LIST V)))
			(ADD1 (LENGTH Y)))),

  which we will name *1.1.

Case 1. (IMPLIES (NOT (LISTP X))
		 (EQUAL (LENGTH (REVERSE X))
			(LENGTH X))),

  which we simplify, opening up REVERSE, LENGTH, and EQUAL, to:

        T.


     So let us turn our attention to:

      (IMPLIES (PLISTP Y)
	       (EQUAL (LENGTH (APPEND Y (LIST V)))
		      (ADD1 (LENGTH Y)))),

which we named *1.1 above.  Let us appeal to the induction principle.
Three inductions are suggested by terms in the conjecture.  However,
they merge into one likely candidate induction.  We will induct
according to the following scheme:
      (AND (IMPLIES (AND (LISTP Y) (P (CDR Y) V))
		    (P Y V))
	   (IMPLIES (NOT (LISTP Y)) (P Y V))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme leads
to three new formulas:

Case 3. (IMPLIES (AND (LISTP Y)
		      (NOT (PLISTP (CDR Y)))
		      (PLISTP Y))
		 (EQUAL (LENGTH (APPEND Y (LIST V)))
			(ADD1 (LENGTH Y)))),

  which simplifies, unfolding the definition of PLISTP, to:

        T.

Case 2. (IMPLIES (AND (LISTP Y)
		      (EQUAL (LENGTH (APPEND (CDR Y) (LIST V)))
			     (ADD1 (LENGTH (CDR Y))))
		      (PLISTP Y))
		 (EQUAL (LENGTH (APPEND Y (LIST V)))
			(ADD1 (LENGTH Y)))).

  This simplifies, rewriting with CDR-CONS, and expanding the
  functions PLISTP, APPEND, and LENGTH, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP Y)) (PLISTP Y))
		 (EQUAL (LENGTH (APPEND Y (LIST V)))
			(ADD1 (LENGTH Y)))),

  which simplifies, applying CDR-CONS, and opening up the definitions
  of PLISTP, LISTP, APPEND, ADD1, LENGTH, and EQUAL, to:

        T.


     That finishes the proof of *1.1, which also finishes the proof
of *1.  Q.E.D.


[ 1.0290161 0.464986164 ]

LENGTH-REVERSE 


(DEFN INTERSECT
      (X Y)
      (IF (LISTP X)
	  (IF (MEMBER (CAR X) Y)
	      (CONS (CAR X) (INTERSECT (CDR X) Y))
	      (INTERSECT (CDR X) Y))
	  NIL))
     Linear arithmetic and the lemma CDR-LESSP inform us that the
measure (COUNT X) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, INTERSECT is accepted under the
principle of definition.  From the definition we can conclude that:
      (OR (LITATOM (INTERSECT X Y))
	  (LISTP (INTERSECT X Y)))
is a theorem.




[ 0.137996418 0.0490030926 ]

INTERSECT 


(PROVE-LEMMA MEMBER-INTERSECT
	     (REWRITE)
	     (EQUAL (MEMBER A (INTERSECT B C))
		    (AND (MEMBER A B) (MEMBER A C))))
This formula simplifies, expanding the definition of AND, to the
following two new formulas:

Case 2. (IMPLIES (NOT (MEMBER A B))
		 (EQUAL (MEMBER A (INTERSECT B C))
			F)).

  This simplifies again, obviously, to:

        (IMPLIES (NOT (MEMBER A B))
		 (NOT (MEMBER A (INTERSECT B C)))),

  which we will name *1.

Case 1. (IMPLIES (MEMBER A B)
		 (EQUAL (MEMBER A (INTERSECT B C))
			(MEMBER A C))),

  which we would usually push and work on later by induction.  But if
  we must use induction to prove the input conjecture, we prefer to
  induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us consider:

(EQUAL (MEMBER A (INTERSECT B C))
       (AND (MEMBER A B) (MEMBER A C))),

named *1 above.  We will try to prove it by induction.  The recursive
terms in the conjecture suggest three inductions.  They merge into
two likely candidate inductions.  However, only one is unflawed.  We
will induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP B)
			 (MEMBER (CAR B) C)
			 (P A (CDR B) C))
		    (P A B C))
	   (IMPLIES (AND (LISTP B)
			 (NOT (MEMBER (CAR B) C))
			 (P A (CDR B) C))
		    (P A B C))
	   (IMPLIES (NOT (LISTP B)) (P A B C))).
Linear arithmetic and the lemma CDR-LESSP can be used to prove that
the measure (COUNT B) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme leads to three new goals:

Case 3. (IMPLIES (AND (LISTP B)
		      (MEMBER (CAR B) C)
		      (EQUAL (MEMBER A (INTERSECT (CDR B) C))
			     (AND (MEMBER A (CDR B))
				  (MEMBER A C))))
		 (EQUAL (MEMBER A (INTERSECT B C))
			(AND (MEMBER A B) (MEMBER A C)))).

  This simplifies, rewriting with CDR-CONS and CAR-CONS, and
  expanding AND, INTERSECT, and MEMBER, to two new formulas:

  Case 3.2.
          (IMPLIES (AND (LISTP B)
			(MEMBER (CAR B) C)
			(NOT (MEMBER A (CDR B)))
			(EQUAL (MEMBER A (INTERSECT (CDR B) C))
			       F)
			(EQUAL A (CAR B)))
		   (EQUAL (MEMBER A C) T)),

    which we again simplify, clearly, to:

          T.

  Case 3.1.
          (IMPLIES (AND (LISTP B)
			(MEMBER (CAR B) C)
			(MEMBER A (CDR B))
			(EQUAL (MEMBER A (INTERSECT (CDR B) C))
			       (MEMBER A C))
			(EQUAL A (CAR B)))
		   (EQUAL T (MEMBER A C))).

    This simplifies again, trivially, to:

          T.

Case 2. (IMPLIES (AND (LISTP B)
		      (NOT (MEMBER (CAR B) C))
		      (EQUAL (MEMBER A (INTERSECT (CDR B) C))
			     (AND (MEMBER A (CDR B))
				  (MEMBER A C))))
		 (EQUAL (MEMBER A (INTERSECT B C))
			(AND (MEMBER A B) (MEMBER A C)))),

  which we simplify, unfolding the definitions of AND, INTERSECT, and
  MEMBER, to:

        (IMPLIES (AND (LISTP B)
		      (NOT (MEMBER (CAR B) C))
		      (NOT (MEMBER A (CDR B)))
		      (EQUAL (MEMBER A (INTERSECT (CDR B) C))
			     F)
		      (EQUAL A (CAR B)))
		 (NOT (MEMBER A C))),

  which we again simplify, clearly, to:

        T.

Case 1. (IMPLIES (NOT (LISTP B))
		 (EQUAL (MEMBER A (INTERSECT B C))
			(AND (MEMBER A B) (MEMBER A C)))).

  This simplifies, expanding the functions INTERSECT, LISTP, MEMBER,
  AND, and EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 2.32301027 0.42598877 ]

MEMBER-INTERSECT 


(DEFN UNION
      (X Y)
      (IF (LISTP X)
	  (IF (MEMBER (CAR X) Y)
	      (UNION (CDR X) Y)
	      (CONS (CAR X) (UNION (CDR X) Y)))
	  Y))
     Linear arithmetic and the lemma CDR-LESSP inform us that the
measure (COUNT X) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, UNION is accepted under the
principle of definition.  From the definition we can conclude that:
      (OR (LISTP (UNION X Y))
	  (EQUAL (UNION X Y) Y))
is a theorem.




[ 0.136002604 0.047998047 ]

UNION 


(PROVE-LEMMA MEMBER-UNION NIL
	     (EQUAL (MEMBER A (UNION B C))
		    (OR (MEMBER A B) (MEMBER A C))))
This formula simplifies, expanding the definition of OR, to the
following two new formulas:

Case 2. (IMPLIES (NOT (MEMBER A B))
		 (EQUAL (MEMBER A (UNION B C))
			(MEMBER A C))).

  Give the above formula the name *1.

Case 1. (IMPLIES (MEMBER A B)
		 (EQUAL (MEMBER A (UNION B C)) T)),

  which again simplifies, obviously, to:

        (IMPLIES (MEMBER A B)
		 (MEMBER A (UNION B C))),

  which we would usually push and work on later by induction.  But if
  we must use induction to prove the input conjecture, we prefer to
  induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us consider:

(EQUAL (MEMBER A (UNION B C))
       (OR (MEMBER A B) (MEMBER A C))),

named *1 above.  We will try to prove it by induction.  The recursive
terms in the conjecture suggest three inductions.  They merge into
two likely candidate inductions.  However, only one is unflawed.  We
will induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP B)
			 (MEMBER (CAR B) C)
			 (P A (CDR B) C))
		    (P A B C))
	   (IMPLIES (AND (LISTP B)
			 (NOT (MEMBER (CAR B) C))
			 (P A (CDR B) C))
		    (P A B C))
	   (IMPLIES (NOT (LISTP B)) (P A B C))).
Linear arithmetic and the lemma CDR-LESSP can be used to prove that
the measure (COUNT B) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme leads to three new goals:

Case 3. (IMPLIES (AND (LISTP B)
		      (MEMBER (CAR B) C)
		      (EQUAL (MEMBER A (UNION (CDR B) C))
			     (OR (MEMBER A (CDR B)) (MEMBER A C))))
		 (EQUAL (MEMBER A (UNION B C))
			(OR (MEMBER A B) (MEMBER A C)))).

  This simplifies, unfolding the definitions of OR, UNION, MEMBER,
  and EQUAL, to:

        (IMPLIES (AND (LISTP B)
		      (MEMBER (CAR B) C)
		      (NOT (MEMBER A (CDR B)))
		      (EQUAL (MEMBER A (UNION (CDR B) C))
			     (MEMBER A C))
		      (EQUAL A (CAR B)))
		 (EQUAL (MEMBER A C) T)),

  which we again simplify, trivially, to:

        T.

Case 2. (IMPLIES (AND (LISTP B)
		      (NOT (MEMBER (CAR B) C))
		      (EQUAL (MEMBER A (UNION (CDR B) C))
			     (OR (MEMBER A (CDR B)) (MEMBER A C))))
		 (EQUAL (MEMBER A (UNION B C))
			(OR (MEMBER A B) (MEMBER A C)))),

  which we simplify, applying CDR-CONS and CAR-CONS, and expanding
  the definitions of OR, UNION, MEMBER, and EQUAL, to:

        T.

Case 1. (IMPLIES (NOT (LISTP B))
		 (EQUAL (MEMBER A (UNION B C))
			(OR (MEMBER A B) (MEMBER A C)))),

  which we simplify, unfolding UNION, MEMBER, and OR, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.4960083 0.363989256 ]

MEMBER-UNION 


(PROVE-LEMMA SUBSETP-UNION NIL
	     (IMPLIES (SUBSETP A B)
		      (EQUAL (UNION A B) B)))

     Give the conjecture the name *1.


     We will try to prove it by induction.  Two inductions are
suggested by terms in the conjecture.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (NLISTP A) (P A B))
	   (IMPLIES (AND (NOT (NLISTP A))
			 (MEMBER (CAR A) B)
			 (P (CDR A) B))
		    (P A B))
	   (IMPLIES (AND (NOT (NLISTP A))
			 (NOT (MEMBER (CAR A) B)))
		    (P A B))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT A) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme leads to the following
four new goals:

Case 4. (IMPLIES (AND (NLISTP A) (SUBSETP A B))
		 (EQUAL (UNION A B) B)),

  which we simplify, expanding NLISTP, SUBSETP, and UNION, to:

        T.

Case 3. (IMPLIES (AND (NOT (NLISTP A))
		      (MEMBER (CAR A) B)
		      (NOT (SUBSETP (CDR A) B))
		      (SUBSETP A B))
		 (EQUAL (UNION A B) B)).

  This simplifies, expanding NLISTP and SUBSETP, to:

        T.

Case 2. (IMPLIES (AND (NOT (NLISTP A))
		      (MEMBER (CAR A) B)
		      (EQUAL (UNION (CDR A) B) B)
		      (SUBSETP A B))
		 (EQUAL (UNION A B) B)).

  This simplifies, opening up the definitions of NLISTP, SUBSETP, and
  UNION, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP A))
		      (NOT (MEMBER (CAR A) B))
		      (SUBSETP A B))
		 (EQUAL (UNION A B) B)),

  which we simplify, opening up NLISTP and SUBSETP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.826993816 0.224007161 ]

SUBSETP-UNION 


(PROVE-LEMMA SUBSETP-INTERSECT NIL
	     (IMPLIES (AND (PLISTP A) (SUBSETP A B))
		      (EQUAL (INTERSECT A B) A)))

     Call the conjecture *1.


     We will appeal to induction.  Three inductions are suggested by
terms in the conjecture.  However, they merge into one likely
candidate induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (AND (LISTP A)
			 (MEMBER (CAR A) B)
			 (P (CDR A) B))
		    (P A B))
	   (IMPLIES (AND (LISTP A)
			 (NOT (MEMBER (CAR A) B))
			 (P (CDR A) B))
		    (P A B))
	   (IMPLIES (NOT (LISTP A)) (P A B))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT A) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
generates seven new goals:

Case 7. (IMPLIES (AND (LISTP A)
		      (MEMBER (CAR A) B)
		      (NOT (PLISTP (CDR A)))
		      (PLISTP A)
		      (SUBSETP A B))
		 (EQUAL (INTERSECT A B) A)),

  which we simplify, unfolding PLISTP, to:

        T.

Case 6. (IMPLIES (AND (LISTP A)
		      (MEMBER (CAR A) B)
		      (NOT (SUBSETP (CDR A) B))
		      (PLISTP A)
		      (SUBSETP A B))
		 (EQUAL (INTERSECT A B) A)),

  which simplifies, expanding the definitions of PLISTP and SUBSETP,
  to:

        T.

Case 5. (IMPLIES (AND (LISTP A)
		      (MEMBER (CAR A) B)
		      (EQUAL (INTERSECT (CDR A) B) (CDR A))
		      (PLISTP A)
		      (SUBSETP A B))
		 (EQUAL (INTERSECT A B) A)),

  which we simplify, rewriting with CONS-CAR-CDR, and unfolding the
  functions PLISTP, SUBSETP, and INTERSECT, to:

        T.

Case 4. (IMPLIES (AND (LISTP A)
		      (NOT (MEMBER (CAR A) B))
		      (NOT (PLISTP (CDR A)))
		      (PLISTP A)
		      (SUBSETP A B))
		 (EQUAL (INTERSECT A B) A)).

  This simplifies, opening up the function PLISTP, to:

        T.

Case 3. (IMPLIES (AND (LISTP A)
		      (NOT (MEMBER (CAR A) B))
		      (NOT (SUBSETP (CDR A) B))
		      (PLISTP A)
		      (SUBSETP A B))
		 (EQUAL (INTERSECT A B) A)).

  This simplifies, expanding PLISTP and SUBSETP, to:

        T.

Case 2. (IMPLIES (AND (LISTP A)
		      (NOT (MEMBER (CAR A) B))
		      (EQUAL (INTERSECT (CDR A) B) (CDR A))
		      (PLISTP A)
		      (SUBSETP A B))
		 (EQUAL (INTERSECT A B) A)),

  which we simplify, opening up PLISTP and SUBSETP, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP A))
		      (PLISTP A)
		      (SUBSETP A B))
		 (EQUAL (INTERSECT A B) A)),

  which simplifies, expanding the definitions of PLISTP, LISTP,
  SUBSETP, INTERSECT, and EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.82201742 0.317980956 ]

SUBSETP-INTERSECT 


(DEFN NTH
      (X N)
      (IF (ZEROP N)
	  X
	  (NTH (CDR X) (SUB1 N))))
     Linear arithmetic, the lemma COUNT-NUMBERP, and the definition
of ZEROP establish that the measure (COUNT N) decreases according to
the well-founded relation LESSP in each recursive call.  Hence, NTH
is accepted under the definitional principle.




[ 0.205997722 0.0359985353 ]

NTH 


(DEFN GREATEREQP (X Y) ( LEQ Y X))
     Note that:
      (OR (FALSEP (GREATEREQP X Y))
	  (TRUEP (GREATEREQP X Y)))
is a theorem.




[ 0.08100179 0.0149983724 ]

GREATEREQP 


(PROVE-LEMMA TRANSITIVITY-OF-LEQ NIL
	     (IMPLIES (AND (LEQ X Y) (LEQ Y Z))
		      (LEQ X Z)))
This formula simplifies, using linear arithmetic, to:

      T.

Q.E.D.


[ 0.0710001625 0.0140014648 ]

TRANSITIVITY-OF-LEQ 


(DEFN ORDERED
      (L)
      (IF (LISTP L)
	  (IF (LISTP (CDR L))
	      (IF (LESSP (CADR L) (CAR L))
		  F
		  (ORDERED (CDR L)))
	      T)
	  T))
     Linear arithmetic and the lemma CDR-LESSP inform us that the
measure (COUNT L) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, ORDERED is accepted under the
definitional principle.  Note that:
      (OR (FALSEP (ORDERED L))
	  (TRUEP (ORDERED L)))
is a theorem.




[ 0.106001791 0.0439982098 ]

ORDERED 


(DEFN ADDTOLIST
      (X L)
      (IF (LISTP L)
	  (IF (LESSP X (CAR L))
	      (CONS X L)
	      (CONS (CAR L) (ADDTOLIST X (CDR L))))
	  (CONS X NIL)))
     Linear arithmetic and the lemma CDR-LESSP can be used to
establish that the measure (COUNT L) decreases according to the
well-founded relation LESSP in each recursive call.  Hence, ADDTOLIST
is accepted under the definitional principle.  Observe that
(LISTP (ADDTOLIST X L)) is a theorem.




[ 0.90799967 0.0420003254 ]

ADDTOLIST 


(DEFN SORT
      (L)
      (IF (LISTP L)
	  (ADDTOLIST (CAR L) (SORT (CDR L)))
	  NIL))
     Linear arithmetic and the lemma CDR-LESSP establish that the
measure (COUNT L) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, SORT is accepted under the
principle of definition.  Note that:
      (OR (LITATOM (SORT L))
	  (LISTP (SORT L)))
is a theorem.




[ 0.079003906 0.0439982098 ]

SORT 


(DEFN ASSOC
      (X Y)
      (IF (LISTP Y)
	  (IF (EQUAL X (CAAR Y))
	      (CAR Y)
	      (ASSOC X (CDR Y)))
	  NIL))
     Linear arithmetic and the lemma CDR-LESSP inform us that the
measure (COUNT Y) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, ASSOC is accepted under the
principle of definition.




[ 0.090999349 0.0329996743 ]

ASSOC 


(DEFN BOOLEAN
      (X)
      (OR (EQUAL X T) (EQUAL X F)))
     Note that (OR (FALSEP (BOOLEAN X)) (TRUEP (BOOLEAN X))) is a
theorem.




[ 0.0299967448 0.0120035807 ]

BOOLEAN 


(DEFN IFF
      (X Y)
      (AND (IMPLIES X Y) (IMPLIES Y X)))
     From the definition we can conclude that:
      (OR (FALSEP (IFF X Y))
	  (TRUEP (IFF X Y)))
is a theorem.




[ 0.0510050454 0.017993164 ]

IFF 


(PROVE-LEMMA IFF-EQUAL-EQUAL NIL
	     (IMPLIES (AND (BOOLEAN P) (BOOLEAN Q))
		      (EQUAL (IFF P Q) (EQUAL P Q))))
This conjecture simplifies, expanding the definitions of BOOLEAN, IFF,
and EQUAL, to:

      T.

Q.E.D.


[ 0.139998373 0.0190022786 ]

IFF-EQUAL-EQUAL 


(PROVE-LEMMA NTH-0
	     (REWRITE)
	     (EQUAL (NTH 0. I) 0.))

     Call the conjecture *1.


     We will appeal to induction.  There is only one plausible
induction.  We will induct according to the following scheme:
      (AND (IMPLIES (ZEROP I) (P I))
	   (IMPLIES (AND (NOT (ZEROP I)) (P (SUB1 I)))
		    (P I))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP establish that the measure (COUNT I) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme generates two new goals:

Case 2. (IMPLIES (ZEROP I)
		 (EQUAL (NTH 0 I) 0)),

  which we simplify, unfolding ZEROP, NTH, and EQUAL, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP I))
		      (EQUAL (NTH 0 (SUB1 I)) 0))
		 (EQUAL (NTH 0 I) 0)),

  which simplifies, expanding the definitions of ZEROP, NTH, CDR, and
  EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.224003093 0.133992514 ]

NTH-0 


(PROVE-LEMMA NTH-NIL
	     (REWRITE)
	     (EQUAL (NTH NIL I)
		    (IF (ZEROP I) NIL 0.)))
This formula simplifies, applying the lemma NTH-0, and opening up CDR,
NTH, and ZEROP, to:

      T.

Q.E.D.


[ 0.121004232 0.0219970704 ]

NTH-NIL 


(PROVE-LEMMA NTH-APPEND1
	     (REWRITE)
	     (EQUAL (NTH A (PLUS I J))
		    (NTH (NTH A I) J)))

     Give the conjecture the name *1.


     Let us appeal to the induction principle.  The recursive terms
in the conjecture suggest three inductions.  They merge into two
likely candidate inductions.  However, only one is unflawed.  We will
induct according to the following scheme:
      (AND (IMPLIES (ZEROP I) (P A I J))
	   (IMPLIES (AND (NOT (ZEROP I))
			 (P (CDR A) (SUB1 I) J))
		    (P A I J))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the
definition of ZEROP inform us that the measure (COUNT I) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  Note, however, the inductive instance chosen for A.
The above induction scheme generates two new conjectures:

Case 2. (IMPLIES (ZEROP I)
		 (EQUAL (NTH A (PLUS I J))
			(NTH (NTH A I) J))),

  which simplifies, opening up the definitions of ZEROP, EQUAL, PLUS,
  and NTH, to the following two new formulas:

  Case 2.2.
          (IMPLIES (AND (EQUAL I 0) (NOT (NUMBERP J)))
		   (EQUAL (NTH A 0) (NTH A J))),

    which again simplifies, expanding the definitions of EQUAL and
    NTH, to:

          T.

  Case 2.1.
          (IMPLIES (AND (NOT (NUMBERP I))
			(NOT (NUMBERP J)))
		   (EQUAL (NTH A 0) (NTH A J))),

    which we again simplify, unfolding EQUAL and NTH, to:

          T.

Case 1. (IMPLIES (AND (NOT (ZEROP I))
		      (EQUAL (NTH (CDR A) (PLUS (SUB1 I) J))
			     (NTH (NTH (CDR A) (SUB1 I)) J)))
		 (EQUAL (NTH A (PLUS I J))
			(NTH (NTH A I) J))),

  which simplifies, rewriting with SUB1-ADD1, and opening up the
  functions ZEROP, PLUS, and NTH, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.86200358 0.232995605 ]

NTH-APPEND1 


(PROVE-LEMMA ASSOCIATIVITY-OF-EQUAL NIL
	     (IMPLIES (AND (BOOLEAN A)
			   (AND (BOOLEAN B) (BOOLEAN C)))
		      (EQUAL (EQUAL (EQUAL A B) C)
			     (EQUAL A (EQUAL B C)))))
This conjecture simplifies, expanding the definitions of BOOLEAN and
EQUAL, to:

      T.

Q.E.D.


[ 0.292000327 0.017997233 ]

ASSOCIATIVITY-OF-EQUAL 


(DEFN ODD
      (X)
      (IF (ZEROP X)
	  F
	  (IF (ZEROP (SUB1 X))
	      T
	      (ODD (SUB1 (SUB1 X))))))
     Linear arithmetic, the lemma COUNT-NUMBERP, and the definition
of ZEROP inform us that the measure (COUNT X) decreases according to
the well-founded relation LESSP in each recursive call.  Hence, ODD
is accepted under the principle of definition.  From the definition
we can conclude that (OR (FALSEP (ODD X)) (TRUEP (ODD X))) is a
theorem.




[ 0.244999187 0.0489990236 ]

ODD 


(DEFN EVEN1
      (X)
      (IF (ZEROP X) T (ODD (SUB1 X))))
     From the definition we can conclude that:
      (OR (FALSEP (EVEN1 X))
	  (TRUEP (EVEN1 X)))
is a theorem.




[ 0.0409993487 0.0170003255 ]

EVEN1 


(DEFN EVEN2
      (X)
      (IF (ZEROP X)
	  T
	  (IF (ZEROP (SUB1 X))
	      F
	      (EVEN2 (SUB1 (SUB1 X))))))
     Linear arithmetic, the lemma COUNT-NUMBERP, and the definition
of ZEROP inform us that the measure (COUNT X) decreases according to
the well-founded relation LESSP in each recursive call.  Hence, EVEN2
is accepted under the principle of definition.  From the definition
we can conclude that (OR (FALSEP (EVEN2 X)) (TRUEP (EVEN2 X))) is a
theorem.




[ 0.247005207 0.048994954 ]

EVEN2 


(DEFN DOUBLE
      (I)
      (IF (ZEROP I)
	  0.
	  (ADD1 (ADD1 (DOUBLE (SUB1 I))))))
     Linear arithmetic, the lemma COUNT-NUMBERP, and the definition
of ZEROP establish that the measure (COUNT I) decreases according to
the well-founded relation LESSP in each recursive call.  Hence,
DOUBLE is accepted under the definitional principle.  From the
definition we can conclude that (NUMBERP (DOUBLE I)) is a theorem.




[ 0.175 0.0449991864 ]

DOUBLE 


(PROVE-LEMMA EVEN1-DOUBLE
	     (REWRITE)
	     (EVEN1 (DOUBLE I)))

WARNING:  Note that the rewrite rule EVEN1-DOUBLE will be stored so
as to apply only to terms with the nonrecursive function symbol EVEN1.

This conjecture can be simplified, using the abbreviation EVEN1, to:

      (IMPLIES (AND (NOT (EQUAL (DOUBLE I) 0))
		    (NUMBERP (DOUBLE I)))
	       (ODD (SUB1 (DOUBLE I)))).

Of course, this simplifies, clearly, to:

      (IMPLIES (NOT (EQUAL (DOUBLE I) 0))
	       (ODD (SUB1 (DOUBLE I)))),

which we will name *1.


     We will appeal to induction.  There are two plausible inductions.
However, they merge into one likely candidate induction.  We will
induct according to the following scheme:
      (AND (IMPLIES (ZEROP I) (P I))
	   (IMPLIES (AND (NOT (ZEROP I)) (P (SUB1 I)))
		    (P I))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP establish that the measure (COUNT I) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme leads to the following three new
conjectures:

Case 3. (IMPLIES (AND (ZEROP I)
		      (NOT (EQUAL (DOUBLE I) 0)))
		 (ODD (SUB1 (DOUBLE I)))).

  This simplifies, expanding the definitions of ZEROP, DOUBLE, and
  EQUAL, to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP I))
		      (EQUAL (DOUBLE (SUB1 I)) 0)
		      (NOT (EQUAL (DOUBLE I) 0)))
		 (ODD (SUB1 (DOUBLE I)))),

  which simplifies, unfolding the functions ZEROP, DOUBLE, ADD1,
  EQUAL, SUB1, and ODD, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP I))
		      (ODD (SUB1 (DOUBLE (SUB1 I))))
		      (NOT (EQUAL (DOUBLE I) 0)))
		 (ODD (SUB1 (DOUBLE I)))).

  This simplifies, appealing to the lemma SUB1-ADD1, and opening up
  ZEROP, DOUBLE, and ODD, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.748994954 0.22500407 ]

EVEN1-DOUBLE 


(DEFN HALF
      (I)
      (IF (ZEROP I)
	  0.
	  (IF (ZEROP (SUB1 I))
	      0.
	      (ADD1 (HALF (SUB1 (SUB1 I)))))))
     Linear arithmetic, the lemma COUNT-NUMBERP, and the definition
of ZEROP can be used to prove that the measure (COUNT I) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, HALF is accepted under the principle of definition.  Observe
that (NUMBERP (HALF I)) is a theorem.




[ 0.248002116 0.0460001626 ]

HALF 


(PROVE-LEMMA HALF-DOUBLE
	     (REWRITE)
	     (IMPLIES (NUMBERP I)
		      (EQUAL (HALF (DOUBLE I)) I)))

     Give the conjecture the name *1.


     We will try to prove it by induction.  There is only one
suggested induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (ZEROP I) (P I))
	   (IMPLIES (AND (NOT (ZEROP I)) (P (SUB1 I)))
		    (P I))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP inform us that the measure (COUNT I) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme leads to the following two new goals:

Case 2. (IMPLIES (AND (ZEROP I) (NUMBERP I))
		 (EQUAL (HALF (DOUBLE I)) I)),

  which we simplify, expanding ZEROP, NUMBERP, DOUBLE, HALF, and
  EQUAL, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP I))
		      (EQUAL (HALF (DOUBLE (SUB1 I)))
			     (SUB1 I))
		      (NUMBERP I))
		 (EQUAL (HALF (DOUBLE I)) I)).

  This simplifies, applying ADD1-SUB1 and SUB1-ADD1, and unfolding
  ZEROP, DOUBLE, and HALF, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.19701742 0.151985677 ]

HALF-DOUBLE 


(PROVE-LEMMA DOUBLE-HALF
	     (REWRITE)
	     (IMPLIES (AND (NUMBERP I) (EVEN1 I))
		      (EQUAL (DOUBLE (HALF I)) I)))
This simplifies, opening up the definitions of EVEN1, HALF, DOUBLE,
and EQUAL, to:

      (IMPLIES (AND (NUMBERP I) (ODD (SUB1 I)))
	       (EQUAL (DOUBLE (HALF I)) I)).

Appealing to the lemma SUB1-ELIM, we now replace I by (ADD1 X) to
eliminate (SUB1 I).  We use the type restriction lemma noted when
SUB1 was introduced to constrain the new variable.  We would thus
like to prove the following two new formulas:

Case 2. (IMPLIES (AND (EQUAL I 0)
		      (NUMBERP I)
		      (ODD (SUB1 I)))
		 (EQUAL (DOUBLE (HALF I)) I)),

  which further simplifies, expanding the definitions of NUMBERP,
  SUB1, and ODD, to:

        T.

Case 1. (IMPLIES (AND (NUMBERP X)
		      (NOT (EQUAL (ADD1 X) 0))
		      (ODD X))
		 (EQUAL (DOUBLE (HALF (ADD1 X)))
			(ADD1 X))),

  which we further simplify, obviously, to:

        (IMPLIES (AND (NUMBERP X) (ODD X))
		 (EQUAL (DOUBLE (HALF (ADD1 X)))
			(ADD1 X))),

  which we would normally push and work on later by induction.  But
  if we must use induction to prove the input conjecture, we prefer
  to induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us return to:

(IMPLIES (AND (NUMBERP I) (EVEN1 I))
	 (EQUAL (DOUBLE (HALF I)) I)).

We named this *1.  We will appeal to induction.  There is only one
suggested induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (ZEROP I) (P I))
	   (IMPLIES (AND (NOT (ZEROP I)) (ZEROP (SUB1 I)))
		    (P I))
	   (IMPLIES (AND (NOT (ZEROP I))
			 (NOT (ZEROP (SUB1 I)))
			 (P (SUB1 (SUB1 I))))
		    (P I))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP can be used to show that the measure (COUNT I) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme leads to four new formulas:

Case 4. (IMPLIES (AND (ZEROP I) (NUMBERP I) (EVEN1 I))
		 (EQUAL (DOUBLE (HALF I)) I)),

  which we simplify, expanding the definitions of ZEROP, NUMBERP,
  EVEN1, HALF, DOUBLE, and EQUAL, to:

        T.

Case 3. (IMPLIES (AND (NOT (ZEROP I))
		      (ZEROP (SUB1 I))
		      (NUMBERP I)
		      (EVEN1 I))
		 (EQUAL (DOUBLE (HALF I)) I)),

  which we simplify, opening up ZEROP, ODD, and EVEN1, to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP I))
		      (NOT (ZEROP (SUB1 I)))
		      (NOT (EVEN1 (SUB1 (SUB1 I))))
		      (NUMBERP I)
		      (EVEN1 I))
		 (EQUAL (DOUBLE (HALF I)) I)),

  which simplifies, expanding the definitions of ZEROP, EVEN1, and
  ODD, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP I))
		      (NOT (ZEROP (SUB1 I)))
		      (EQUAL (DOUBLE (HALF (SUB1 (SUB1 I))))
			     (SUB1 (SUB1 I)))
		      (NUMBERP I)
		      (EVEN1 I))
		 (EQUAL (DOUBLE (HALF I)) I)),

  which we simplify, applying ADD1-SUB1 and SUB1-ADD1, and opening up
  ZEROP, EVEN1, HALF, and DOUBLE, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.33498941 0.401009116 ]

DOUBLE-HALF 


(PROVE-LEMMA DOUBLE-TIMES-2 NIL
	     (EQUAL (DOUBLE I) (TIMES 2. I)))

     Name the conjecture *1.


     We will try to prove it by induction.  There is only one
suggested induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (ZEROP I) (P I))
	   (IMPLIES (AND (NOT (ZEROP I)) (P (SUB1 I)))
		    (P I))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP can be used to prove that the measure (COUNT I) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme produces two new formulas:

Case 2. (IMPLIES (ZEROP I)
		 (EQUAL (DOUBLE I) (TIMES 2 I))).

  This simplifies, applying the lemma TIMES-ZERO2, and expanding the
  definitions of ZEROP, DOUBLE, TIMES, and EQUAL, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP I))
		      (EQUAL (DOUBLE (SUB1 I))
			     (TIMES 2 (SUB1 I))))
		 (EQUAL (DOUBLE I) (TIMES 2 I))),

  which simplifies, unfolding the functions ZEROP and DOUBLE, to:

        (IMPLIES (AND (NOT (EQUAL I 0))
		      (NUMBERP I)
		      (EQUAL (DOUBLE (SUB1 I))
			     (TIMES 2 (SUB1 I))))
		 (EQUAL (ADD1 (ADD1 (DOUBLE (SUB1 I))))
			(TIMES 2 I))).

  Applying the lemma SUB1-ELIM, replace I by (ADD1 X) to eliminate
  (SUB1 I).  We use the type restriction lemma noted when SUB1 was
  introduced to restrict the new variable.  This produces:

        (IMPLIES (AND (NUMBERP X)
		      (NOT (EQUAL (ADD1 X) 0))
		      (EQUAL (DOUBLE X) (TIMES 2 X)))
		 (EQUAL (ADD1 (ADD1 (DOUBLE X)))
			(TIMES 2 (ADD1 X)))),

  which we further simplify, rewriting with TIMES-ADD1, to the new
  conjecture:

        (IMPLIES (AND (NUMBERP X)
		      (EQUAL (DOUBLE X) (TIMES 2 X)))
		 (EQUAL (ADD1 (ADD1 (DOUBLE X)))
			(PLUS 2 (DOUBLE X)))).

  This simplifies again, using linear arithmetic, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.04099528 0.24300944 ]

DOUBLE-TIMES-2 


(PROVE-LEMMA SUBSETP-CONS
	     (REWRITE)
	     (IMPLIES (SUBSETP X Y)
		      (SUBSETP X (CONS Z Y))))

     Give the conjecture the name *1.


     We will try to prove it by induction.  Two inductions are
suggested by terms in the conjecture.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (NLISTP X) (P X Z Y))
	   (IMPLIES (AND (NOT (NLISTP X))
			 (MEMBER (CAR X) Y)
			 (P (CDR X) Z Y))
		    (P X Z Y))
	   (IMPLIES (AND (NOT (NLISTP X))
			 (NOT (MEMBER (CAR X) Y)))
		    (P X Z Y))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme leads to the following
four new goals:

Case 4. (IMPLIES (AND (NLISTP X) (SUBSETP X Y))
		 (SUBSETP X (CONS Z Y))),

  which we simplify, expanding NLISTP and SUBSETP, to:

        T.

Case 3. (IMPLIES (AND (NOT (NLISTP X))
		      (MEMBER (CAR X) Y)
		      (NOT (SUBSETP (CDR X) Y))
		      (SUBSETP X Y))
		 (SUBSETP X (CONS Z Y))).

  This simplifies, expanding NLISTP and SUBSETP, to:

        T.

Case 2. (IMPLIES (AND (NOT (NLISTP X))
		      (MEMBER (CAR X) Y)
		      (SUBSETP (CDR X) (CONS Z Y))
		      (SUBSETP X Y))
		 (SUBSETP X (CONS Z Y))).

  This simplifies, applying the lemmas CDR-CONS and CAR-CONS, and
  expanding the definitions of NLISTP, SUBSETP, and MEMBER, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP X))
		      (NOT (MEMBER (CAR X) Y))
		      (SUBSETP X Y))
		 (SUBSETP X (CONS Z Y))),

  which simplifies, unfolding the functions NLISTP and SUBSETP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.46801351 0.230985515 ]

SUBSETP-CONS 


(PROVE-LEMMA LAST-APPEND
	     (REWRITE)
	     (EQUAL (LAST (APPEND A B))
		    (IF (LISTP B)
			(LAST B)
			(IF (LISTP A)
			    (CONS (CAR (LAST A)) B)
			    B))))
This formula simplifies, clearly, to three new conjectures:

Case 3. (IMPLIES (AND (NOT (LISTP B)) (LISTP A))
		 (EQUAL (LAST (APPEND A B))
			(CONS (CAR (LAST A)) B))),

  which we will name *1.

Case 2. (IMPLIES (AND (NOT (LISTP B)) (NOT (LISTP A)))
		 (EQUAL (LAST (APPEND A B)) B)).

  But this simplifies again, unfolding APPEND and LAST, to:

        T.

Case 1. (IMPLIES (LISTP B)
		 (EQUAL (LAST (APPEND A B)) (LAST B))),

  which we would normally push and work on later by induction.  But
  if we must use induction to prove the input conjecture, we prefer
  to induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us return to:

(EQUAL (LAST (APPEND A B))
       (IF (LISTP B)
	   (LAST B)
	   (IF (LISTP A)
	       (CONS (CAR (LAST A)) B)
	       B))).

We named this *1 above.  Let us appeal to the induction principle.
There are three plausible inductions.  They merge into two likely
candidate inductions.  However, only one is unflawed.  We will induct
according to the following scheme:
      (AND (IMPLIES (AND (LISTP A) (P (CDR A) B))
		    (P A B))
	   (IMPLIES (NOT (LISTP A)) (P A B))).
Linear arithmetic and the lemma CDR-LESSP can be used to establish
that the measure (COUNT A) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme produces the following two new formulas:

Case 2. (IMPLIES (AND (LISTP A)
		      (EQUAL (LAST (APPEND (CDR A) B))
			     (IF (LISTP B)
				 (LAST B)
				 (IF (LISTP (CDR A))
				     (CONS (CAR (LAST (CDR A))) B)
				     B))))
		 (EQUAL (LAST (APPEND A B))
			(IF (LISTP B)
			    (LAST B)
			    (IF (LISTP A)
				(CONS (CAR (LAST A)) B)
				B)))).

  This simplifies, rewriting with the lemma CDR-CONS, and expanding
  APPEND and LAST, to three new formulas:

  Case 2.3.
          (IMPLIES (AND (LISTP A)
			(NOT (LISTP B))
			(LISTP (CDR A))
			(EQUAL (LAST (APPEND (CDR A) B))
			       (CONS (CAR (LAST (CDR A))) B))
			(NOT (LISTP (APPEND (CDR A) B))))
		   (EQUAL (CONS (CAR A) (APPEND (CDR A) B))
			  (LAST (APPEND (CDR A) B)))),

    which we again simplify, expanding the definition of LAST, to:

          T.

  Case 2.2.
          (IMPLIES (AND (LISTP A)
			(NOT (LISTP B))
			(NOT (LISTP (CDR A)))
			(EQUAL (LAST (APPEND (CDR A) B)) B))
		   (EQUAL (CONS (CAR A) (APPEND (CDR A) B))
			  (CONS (CAR A) B))),

    which we again simplify, rewriting with the lemmas CAR-CONS,
    CDR-CONS, and CONS-EQUAL, to:

          (IMPLIES (AND (LISTP A)
			(NOT (LISTP B))
			(NOT (LISTP (CDR A)))
			(EQUAL (LAST (APPEND (CDR A) B)) B))
		   (EQUAL (APPEND (CDR A) B) B)).

    This further simplifies, unfolding the definitions of APPEND and
    LAST, to:

          T.

  Case 2.1.
          (IMPLIES (AND (LISTP A)
			(NOT (LISTP B))
			(NOT (LISTP (CDR A)))
			(EQUAL (LAST (APPEND (CDR A) B)) B))
		   (NOT (LISTP (APPEND (CDR A) B)))).

    Of course, this simplifies again, clearly, to:

          T.

Case 1. (IMPLIES (NOT (LISTP A))
		 (EQUAL (LAST (APPEND A B))
			(IF (LISTP B)
			    (LAST B)
			    (IF (LISTP A)
				(CONS (CAR (LAST A)) B)
				B)))),

  which we simplify, unfolding the definition of APPEND, to the
  formula:

        (IMPLIES (AND (NOT (LISTP A)) (NOT (LISTP B)))
		 (EQUAL (LAST B) B)),

  which we again simplify, unfolding the definition of LAST, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 2.16899413 0.454007976 ]

LAST-APPEND 


(PROVE-LEMMA LAST-REVERSE NIL
	     (IMPLIES (LISTP A)
		      (EQUAL (LAST (REVERSE A))
			     (CONS (CAR A) NIL))))
.

Appealing to the lemma CAR-CDR-ELIM, replace A by (CONS X Z) to
eliminate (CAR A) and (CDR A).  We would thus like to prove:

      (EQUAL (LAST (REVERSE (CONS X Z)))
	     (LIST X)).

However this simplifies, applying the lemmas CAR-CONS, CDR-CONS, and
LAST-APPEND, and unfolding REVERSE, LISTP, and LAST, to:

      T.

Q.E.D.


[ 0.154003907 0.0559977214 ]

LAST-REVERSE 


(DEFN EXP
      (I J)
      (IF (ZEROP J)
	  1.
	  (TIMES I (EXP I (SUB1 J)))))
     Linear arithmetic, the lemma COUNT-NUMBERP, and the definition
of ZEROP establish that the measure (COUNT J) decreases according to
the well-founded relation LESSP in each recursive call.  Hence, EXP
is accepted under the principle of definition.  Note that
(NUMBERP (EXP I J)) is a theorem.




[ 0.206998698 0.0420043943 ]

EXP 


(PROVE-LEMMA EXP-PLUS
	     (REWRITE)
	     (EQUAL (EXP I (PLUS J K))
		    (TIMES (EXP I J) (EXP I K))))

     Give the conjecture the name *1.


     We will try to prove it by induction.  Three inductions are
suggested by terms in the conjecture.  They merge into two likely
candidate inductions.  However, only one is unflawed.  We will induct
according to the following scheme:
      (AND (IMPLIES (ZEROP J) (P I J K))
	   (IMPLIES (AND (NOT (ZEROP J)) (P I (SUB1 J) K))
		    (P I J K))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the
definition of ZEROP establish that the measure (COUNT J) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme leads to the following two
new goals:

Case 2. (IMPLIES (ZEROP J)
		 (EQUAL (EXP I (PLUS J K))
			(TIMES (EXP I J) (EXP I K)))),

  which simplifies, unfolding the definitions of ZEROP, EQUAL, PLUS,
  and EXP, to the following four new conjectures:

  Case 2.4.
          (IMPLIES (AND (EQUAL J 0) (NOT (NUMBERP K)))
		   (EQUAL (EXP I 0)
			  (TIMES 1 (EXP I K)))),

    which we again simplify, opening up EQUAL, EXP, and TIMES, to:

          T.

  Case 2.3.
          (IMPLIES (AND (EQUAL J 0) (NUMBERP K))
		   (EQUAL (EXP I K)
			  (TIMES 1 (EXP I K)))),

    which we again simplify, using linear arithmetic, to:

          T.

  Case 2.2.
          (IMPLIES (AND (NOT (NUMBERP J))
			(NOT (NUMBERP K)))
		   (EQUAL (EXP I 0)
			  (TIMES 1 (EXP I K)))).

    However this again simplifies, opening up the functions EQUAL,
    EXP, and TIMES, to:

          T.

  Case 2.1.
          (IMPLIES (AND (NOT (NUMBERP J)) (NUMBERP K))
		   (EQUAL (EXP I K)
			  (TIMES 1 (EXP I K)))),

    which again simplifies, using linear arithmetic, to:

          T.

Case 1. (IMPLIES (AND (NOT (ZEROP J))
		      (EQUAL (EXP I (PLUS (SUB1 J) K))
			     (TIMES (EXP I (SUB1 J)) (EXP I K))))
		 (EQUAL (EXP I (PLUS J K))
			(TIMES (EXP I J) (EXP I K)))),

  which we simplify, rewriting with COMMUTATIVITY-OF-TIMES, SUB1-ADD1,
  and ASSOCIATIVITY-OF-TIMES, and opening up ZEROP, PLUS, and EXP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 2.01101482 0.284985352 ]

EXP-PLUS 


(PROVE-LEMMA EVEN1-EVEN2 NIL
	     (EQUAL (EVEN1 X) (EVEN2 X)))
This formula simplifies, expanding the definition of EVEN1, to the
following three new formulas:

Case 3. (IMPLIES (AND (NOT (EQUAL X 0)) (NUMBERP X))
		 (EQUAL (ODD (SUB1 X)) (EVEN2 X))).

  Appealing to the lemma SUB1-ELIM, we now replace X by (ADD1 Z) to
  eliminate (SUB1 X).  We rely upon the type restriction lemma noted
  when SUB1 was introduced to restrict the new variable.  We must
  thus prove:

        (IMPLIES (AND (NUMBERP Z)
		      (NOT (EQUAL (ADD1 Z) 0)))
		 (EQUAL (ODD Z) (EVEN2 (ADD1 Z)))).

  This simplifies further, clearly, to the formula:

        (IMPLIES (NUMBERP Z)
		 (EQUAL (ODD Z) (EVEN2 (ADD1 Z)))),

  which we would normally push and work on later by induction.  But
  if we must use induction to prove the input conjecture, we prefer
  to induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us return to:

(EQUAL (EVEN1 X) (EVEN2 X)).

We named this *1.  We will appeal to induction.  There is only one
suggested induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (ZEROP X) (P X))
	   (IMPLIES (AND (NOT (ZEROP X)) (ZEROP (SUB1 X)))
		    (P X))
	   (IMPLIES (AND (NOT (ZEROP X))
			 (NOT (ZEROP (SUB1 X)))
			 (P (SUB1 (SUB1 X))))
		    (P X))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP can be used to show that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme leads to three new
formulas:

Case 3. (IMPLIES (ZEROP X)
		 (EQUAL (EVEN1 X) (EVEN2 X))),

  which we simplify, expanding the definitions of ZEROP, EVEN1, EVEN2,
  and EQUAL, to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP X)) (ZEROP (SUB1 X)))
		 (EQUAL (EVEN1 X) (EVEN2 X))),

  which we simplify, opening up ZEROP, ODD, EVEN1, EVEN2, and EQUAL,
  to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP X))
		      (NOT (ZEROP (SUB1 X)))
		      (EQUAL (EVEN1 (SUB1 (SUB1 X)))
			     (EVEN2 (SUB1 (SUB1 X)))))
		 (EQUAL (EVEN1 X) (EVEN2 X))),

  which simplifies, expanding the definitions of ZEROP, EVEN1, ODD,
  EVEN2, and EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.98700358 0.323999025 ]

EVEN1-EVEN2 


(PROVE-LEMMA LEQ-NTH NIL
	     (LEQ (LENGTH (NTH L I)) (LENGTH L)))

     Name the conjecture *1.


     We will try to prove it by induction.  There are two plausible
inductions.  However, they merge into one likely candidate induction.
We will induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP L) (P (CDR L) (SUB1 I)))
		    (P L I))
	   (IMPLIES (NOT (LISTP L)) (P L I))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT L) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  Note, however, the inductive
instance chosen for I.  The above induction scheme generates the
following two new formulas:

Case 2. (IMPLIES (AND (LISTP L)
		      ( LEQ
			(LENGTH (NTH (CDR L) (SUB1 I)))
			(LENGTH (CDR L))))
		 ( LEQ (LENGTH (NTH L I)) (LENGTH L))),

  which simplifies, applying SUB1-ADD1, and expanding the definitions
  of LENGTH, NTH, and LESSP, to three new formulas:

  Case 2.3.
          (IMPLIES (AND (LISTP L)
			( LEQ
			  (LENGTH (NTH (CDR L) (SUB1 I)))
			  (LENGTH (CDR L)))
			(NOT (NUMBERP I))
			(NOT (EQUAL (LENGTH L) 0)))
		   ( LEQ
		     (SUB1 (LENGTH L))
		     (LENGTH (CDR L)))),

    which we again simplify, rewriting with SUB1-ADD1, and unfolding
    the function LENGTH, to the formula:

          (IMPLIES (AND (LISTP L)
			( LEQ
			  (LENGTH (NTH (CDR L) (SUB1 I)))
			  (LENGTH (CDR L)))
			(NOT (NUMBERP I)))
		   ( LEQ
		     (LENGTH (CDR L))
		     (LENGTH (CDR L)))).

    However this simplifies again, using linear arithmetic, to:

          T.

  Case 2.2.
          (IMPLIES (AND (LISTP L)
			( LEQ
			  (LENGTH (NTH (CDR L) (SUB1 I)))
			  (LENGTH (CDR L)))
			(EQUAL I 0)
			(NOT (EQUAL (LENGTH L) 0)))
		   ( LEQ
		     (SUB1 (LENGTH L))
		     (LENGTH (CDR L)))),

    which we again simplify, rewriting with SUB1-ADD1, and expanding
    the definitions of SUB1, EQUAL, NTH, and LENGTH, to:

          T.

  Case 2.1.
          (IMPLIES (AND (LISTP L)
			( LEQ
			  (LENGTH (NTH (CDR L) (SUB1 I)))
			  (LENGTH (CDR L)))
			(NOT (EQUAL I 0))
			(NUMBERP I)
			(NOT (EQUAL (LENGTH (NTH (CDR L) (SUB1 I)))
				    0)))
		   ( LEQ
		     (SUB1 (LENGTH (NTH (CDR L) (SUB1 I))))
		     (LENGTH (CDR L)))),

    which we again simplify, using linear arithmetic, to:

          T.

Case 1. (IMPLIES (NOT (LISTP L))
		 ( LEQ (LENGTH (NTH L I)) (LENGTH L))),

  which we simplify, unfolding LENGTH, NTH, EQUAL, and LESSP, to
  three new conjectures:

  Case 1.3.
          (IMPLIES (AND (NOT (LISTP L))
			(NOT (EQUAL I 0))
			(NUMBERP I))
		   (EQUAL (LENGTH (NTH (CDR L) (SUB1 I)))
			  0)),

    which we further simplify, applying CDR-NLISTP and NTH-0, and
    opening up LENGTH and EQUAL, to:

          T.

  Case 1.2.
          (IMPLIES (AND (NOT (LISTP L)) (EQUAL I 0))
		   (EQUAL (LENGTH L) 0)).

    But this simplifies again, unfolding the definitions of LENGTH
    and EQUAL, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NOT (LISTP L))
			(NOT (NUMBERP I)))
		   (EQUAL (LENGTH L) 0)),

    which again simplifies, unfolding LENGTH and EQUAL, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 1.7579956 0.396004234 ]

LEQ-NTH 


(PROVE-LEMMA MEMBER-SORT NIL
	     (EQUAL (MEMBER A (SORT B))
		    (MEMBER A B)))

     Call the conjecture *1.


     Perhaps we can prove it by induction.  There are two plausible
inductions.  However, they merge into one likely candidate induction.
We will induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP B) (P A (CDR B)))
		    (P A B))
	   (IMPLIES (NOT (LISTP B)) (P A B))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT B) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
produces two new formulas:

Case 2. (IMPLIES (AND (LISTP B)
		      (EQUAL (MEMBER A (SORT (CDR B)))
			     (MEMBER A (CDR B))))
		 (EQUAL (MEMBER A (SORT B))
			(MEMBER A B))).

  This simplifies, expanding the definitions of SORT and MEMBER, to
  two new goals:

  Case 2.2.
          (IMPLIES (AND (LISTP B)
			(EQUAL (MEMBER A (SORT (CDR B)))
			       (MEMBER A (CDR B)))
			(NOT (EQUAL A (CAR B))))
		   (EQUAL (MEMBER A
				  (ADDTOLIST (CAR B) (SORT (CDR B))))
			  (MEMBER A (CDR B)))).

    Applying the lemma CAR-CDR-ELIM, we now replace B by (CONS Z X)
    to eliminate (CDR B) and (CAR B).  We must thus prove:

          (IMPLIES (AND (EQUAL (MEMBER A (SORT X))
			       (MEMBER A X))
			(NOT (EQUAL A Z)))
		   (EQUAL (MEMBER A (ADDTOLIST Z (SORT X)))
			  (MEMBER A X))).

    We use the above equality hypothesis by substituting
    (MEMBER A (SORT X)) for (MEMBER A X) and throwing away the
    equality.  This generates:

          (IMPLIES (NOT (EQUAL A Z))
		   (EQUAL (MEMBER A (ADDTOLIST Z (SORT X)))
			  (MEMBER A (SORT X)))),

    which we generalize by replacing (SORT X) by Y.  We would thus
    like to prove the formula:

          (IMPLIES (NOT (EQUAL A Z))
		   (EQUAL (MEMBER A (ADDTOLIST Z Y))
			  (MEMBER A Y))),

    which we will name *1.1.

  Case 2.1.
          (IMPLIES (AND (LISTP B)
			(EQUAL (MEMBER A (SORT (CDR B)))
			       (MEMBER A (CDR B)))
			(EQUAL A (CAR B)))
		   (EQUAL (MEMBER A
				  (ADDTOLIST (CAR B) (SORT (CDR B))))
			  T)).

    This again simplifies, trivially, to the new conjecture:

          (IMPLIES (AND (LISTP B)
			(EQUAL (MEMBER (CAR B) (SORT (CDR B)))
			       (MEMBER (CAR B) (CDR B))))
		   (MEMBER (CAR B)
			   (ADDTOLIST (CAR B) (SORT (CDR B))))).

    Applying the lemma CAR-CDR-ELIM, we now replace B by (CONS X Z)
    to eliminate (CAR B) and (CDR B).  This produces the new
    conjecture:

          (IMPLIES (EQUAL (MEMBER X (SORT Z))
			  (MEMBER X Z))
		   (MEMBER X (ADDTOLIST X (SORT Z)))).

    We will try to prove the above formula by generalizing it,
    replacing (SORT Z) by Y.  We would thus like to prove the new
    formula:

          (IMPLIES (EQUAL (MEMBER X Y) (MEMBER X Z))
		   (MEMBER X (ADDTOLIST X Y))).

    Name the above subgoal *1.2.

Case 1. (IMPLIES (NOT (LISTP B))
		 (EQUAL (MEMBER A (SORT B))
			(MEMBER A B))).

  This simplifies, expanding the definitions of SORT, LISTP, MEMBER,
  and EQUAL, to:

        T.


     So next consider:

      (IMPLIES (EQUAL (MEMBER X Y) (MEMBER X Z))
	       (MEMBER X (ADDTOLIST X Y))),

which is formula *1.2 above.  We will appeal to induction.  There are
three plausible inductions.  They merge into two likely candidate
inductions, both of which are unflawed.  However, one of these is
more likely than the other.  We will induct according to the
following scheme:
      (AND (IMPLIES (NLISTP Y) (P X Y Z))
	   (IMPLIES (AND (NOT (NLISTP Y))
			 (EQUAL X (CAR Y)))
		    (P X Y Z))
	   (IMPLIES (AND (NOT (NLISTP Y))
			 (NOT (EQUAL X (CAR Y)))
			 (P X (CDR Y) Z))
		    (P X Y Z))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP can be used to establish that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
generates four new conjectures:

Case 4. (IMPLIES (AND (NLISTP Y)
		      (EQUAL (MEMBER X Y) (MEMBER X Z)))
		 (MEMBER X (ADDTOLIST X Y))),

  which we simplify, rewriting with the lemma CAR-CONS, and expanding
  the definitions of NLISTP, MEMBER, and ADDTOLIST, to:

        T.

Case 3. (IMPLIES (AND (NOT (NLISTP Y))
		      (EQUAL X (CAR Y))
		      (EQUAL (MEMBER X Y) (MEMBER X Z)))
		 (MEMBER X (ADDTOLIST X Y))).

  This simplifies, expanding the definitions of NLISTP and MEMBER, to
  the new goal:

        (IMPLIES (AND (LISTP Y) (MEMBER (CAR Y) Z))
		 (MEMBER (CAR Y)
			 (ADDTOLIST (CAR Y) Y))).

  Applying the lemma CAR-CDR-ELIM, replace Y by (CONS V W) to
  eliminate (CAR Y) and (CDR Y).  We would thus like to prove the
  conjecture:

        (IMPLIES (MEMBER V Z)
		 (MEMBER V (ADDTOLIST V (CONS V W)))),

  which we further simplify, applying CDR-CONS and CAR-CONS, and
  opening up the definition of ADDTOLIST, to two new goals:

  Case 3.2.
          (IMPLIES (AND (MEMBER V Z) ( LEQ V V))
		   (MEMBER V (CONS V (ADDTOLIST V W)))),

    which we again simplify, applying CAR-CONS, and expanding MEMBER,
    to:

          T.

  Case 3.1.
          (IMPLIES (AND (MEMBER V Z) (LESSP V V))
		   (MEMBER V (CONS V (CONS V W)))),

    which again simplifies, using linear arithmetic, to:

          T.

Case 2. (IMPLIES (AND (NOT (NLISTP Y))
		      (NOT (EQUAL X (CAR Y)))
		      (NOT (EQUAL (MEMBER X (CDR Y))
				  (MEMBER X Z)))
		      (EQUAL (MEMBER X Y) (MEMBER X Z)))
		 (MEMBER X (ADDTOLIST X Y))),

  which simplifies, expanding the functions NLISTP and MEMBER, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP Y))
		      (NOT (EQUAL X (CAR Y)))
		      (MEMBER X (ADDTOLIST X (CDR Y)))
		      (EQUAL (MEMBER X Y) (MEMBER X Z)))
		 (MEMBER X (ADDTOLIST X Y))).

  This simplifies, unfolding the definitions of NLISTP, MEMBER, and
  ADDTOLIST, to the following two new formulas:

  Case 1.2.
          (IMPLIES (AND (LISTP Y)
			(NOT (EQUAL X (CAR Y)))
			(MEMBER X (ADDTOLIST X (CDR Y)))
			(EQUAL (MEMBER X (CDR Y))
			       (MEMBER X Z))
			( LEQ (CAR Y) X))
		   (MEMBER X
			   (CONS (CAR Y)
				 (ADDTOLIST X (CDR Y))))).

    This simplifies again, rewriting with CDR-CONS and CAR-CONS, and
    expanding the function MEMBER, to:

          T.

  Case 1.1.
          (IMPLIES (AND (LISTP Y)
			(NOT (EQUAL X (CAR Y)))
			(MEMBER X (ADDTOLIST X (CDR Y)))
			(EQUAL (MEMBER X (CDR Y))
			       (MEMBER X Z))
			(LESSP X (CAR Y)))
		   (MEMBER X (CONS X Y))),

    which we again simplify, applying the lemma CAR-CONS, and
    expanding the function MEMBER, to:

          T.


     That finishes the proof of *1.2.


     So next consider:

      (IMPLIES (NOT (EQUAL A Z))
	       (EQUAL (MEMBER A (ADDTOLIST Z Y))
		      (MEMBER A Y))),

named *1.1 above.  We will try to prove it by induction.  Two
inductions are suggested by terms in the conjecture.  However, they
merge into one likely candidate induction.  We will induct according
to the following scheme:
      (AND (IMPLIES (AND (LISTP Y) (LESSP Z (CAR Y)))
		    (P A Z Y))
	   (IMPLIES (AND (LISTP Y)
			 ( LEQ (CAR Y) Z)
			 (P A Z (CDR Y)))
		    (P A Z Y))
	   (IMPLIES (NOT (LISTP Y)) (P A Z Y))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme leads
to the following three new conjectures:

Case 3. (IMPLIES (AND (LISTP Y)
		      (LESSP Z (CAR Y))
		      (NOT (EQUAL A Z)))
		 (EQUAL (MEMBER A (ADDTOLIST Z Y))
			(MEMBER A Y))),

  which simplifies, unfolding the definitions of ADDTOLIST and MEMBER,
  to the following two new formulas:

  Case 3.2.
          (IMPLIES (AND (LISTP Y)
			(LESSP Z (CAR Y))
			(NOT (EQUAL A Z))
			(NOT (EQUAL A (CAR Y))))
		   (EQUAL (MEMBER A (CONS Z Y))
			  (MEMBER A (CDR Y)))),

    which we again simplify, rewriting with the lemmas CDR-CONS and
    CAR-CONS, and unfolding the function MEMBER, to:

          T.

  Case 3.1.
          (IMPLIES (AND (LISTP Y)
			(LESSP Z (CAR Y))
			(NOT (EQUAL A Z))
			(EQUAL A (CAR Y)))
		   (EQUAL (MEMBER A (CONS Z Y)) T)),

    which again simplifies, rewriting with CDR-CONS and CAR-CONS, and
    expanding MEMBER and EQUAL, to:

          T.

Case 2. (IMPLIES (AND (LISTP Y)
		      ( LEQ (CAR Y) Z)
		      (EQUAL (MEMBER A (ADDTOLIST Z (CDR Y)))
			     (MEMBER A (CDR Y)))
		      (NOT (EQUAL A Z)))
		 (EQUAL (MEMBER A (ADDTOLIST Z Y))
			(MEMBER A Y))).

  This simplifies, applying CDR-CONS and CAR-CONS, and unfolding the
  definitions of ADDTOLIST and MEMBER, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP Y))
		      (NOT (EQUAL A Z)))
		 (EQUAL (MEMBER A (ADDTOLIST Z Y))
			(MEMBER A Y))).

  This simplifies, rewriting with the lemmas CDR-CONS and CAR-CONS,
  and unfolding the definitions of ADDTOLIST, MEMBER, LISTP, and
  EQUAL, to:

        T.


     That finishes the proof of *1.1, which, consequently, finishes
the proof of *1.  Q.E.D.


[ 6.1519735 1.13602702 ]

MEMBER-SORT 


(PROVE-LEMMA LENGTH-SORT NIL
	     (EQUAL (LENGTH (SORT A)) (LENGTH A)))

     Name the conjecture *1.


     Perhaps we can prove it by induction.  The recursive terms in
the conjecture suggest two inductions.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (LISTP A) (P (CDR A)))
		    (P A))
	   (IMPLIES (NOT (LISTP A)) (P A))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT A) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
produces two new formulas:

Case 2. (IMPLIES (AND (LISTP A)
		      (EQUAL (LENGTH (SORT (CDR A)))
			     (LENGTH (CDR A))))
		 (EQUAL (LENGTH (SORT A)) (LENGTH A))).

  This simplifies, opening up the definitions of SORT and LENGTH, to:

        (IMPLIES (AND (LISTP A)
		      (EQUAL (LENGTH (SORT (CDR A)))
			     (LENGTH (CDR A))))
		 (EQUAL (LENGTH (ADDTOLIST (CAR A) (SORT (CDR A))))
			(ADD1 (LENGTH (CDR A))))).

  Applying the lemma CAR-CDR-ELIM, we now replace A by (CONS Z X) to
  eliminate (CDR A) and (CAR A).  We must thus prove:

        (IMPLIES (EQUAL (LENGTH (SORT X)) (LENGTH X))
		 (EQUAL (LENGTH (ADDTOLIST Z (SORT X)))
			(ADD1 (LENGTH X)))).

  We use the above equality hypothesis by substituting
  (LENGTH (SORT X)) for (LENGTH X) and throwing away the equality.
  We must thus prove:

        (EQUAL (LENGTH (ADDTOLIST Z (SORT X)))
	       (ADD1 (LENGTH (SORT X)))).

  We will try to prove the above conjecture by generalizing it,
  replacing (SORT X) by Y.  This generates:

        (EQUAL (LENGTH (ADDTOLIST Z Y))
	       (ADD1 (LENGTH Y))).

  Call the above conjecture *1.1.

Case 1. (IMPLIES (NOT (LISTP A))
		 (EQUAL (LENGTH (SORT A)) (LENGTH A))),

  which we simplify, opening up SORT, LENGTH, and EQUAL, to:

        T.


     So let us turn our attention to:

      (EQUAL (LENGTH (ADDTOLIST Z Y))
	     (ADD1 (LENGTH Y))),

which we named *1.1 above.  Let us appeal to the induction principle.
Two inductions are suggested by terms in the conjecture.  However,
they merge into one likely candidate induction.  We will induct
according to the following scheme:
      (AND (IMPLIES (AND (LISTP Y) (LESSP Z (CAR Y)))
		    (P Z Y))
	   (IMPLIES (AND (LISTP Y)
			 ( LEQ (CAR Y) Z)
			 (P Z (CDR Y)))
		    (P Z Y))
	   (IMPLIES (NOT (LISTP Y)) (P Z Y))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme leads
to three new formulas:

Case 3. (IMPLIES (AND (LISTP Y) (LESSP Z (CAR Y)))
		 (EQUAL (LENGTH (ADDTOLIST Z Y))
			(ADD1 (LENGTH Y)))),

  which simplifies, unfolding the definitions of ADDTOLIST and LENGTH,
  to:

        (IMPLIES (AND (LISTP Y) (LESSP Z (CAR Y)))
		 (EQUAL (LENGTH (CONS Z Y))
			(ADD1 (ADD1 (LENGTH (CDR Y)))))).

  However this again simplifies, rewriting with the lemma CDR-CONS,
  and unfolding the definition of LENGTH, to:

        T.

Case 2. (IMPLIES (AND (LISTP Y)
		      ( LEQ (CAR Y) Z)
		      (EQUAL (LENGTH (ADDTOLIST Z (CDR Y)))
			     (ADD1 (LENGTH (CDR Y)))))
		 (EQUAL (LENGTH (ADDTOLIST Z Y))
			(ADD1 (LENGTH Y)))),

  which simplifies, rewriting with CDR-CONS, and unfolding the
  functions ADDTOLIST and LENGTH, to:

        T.

Case 1. (IMPLIES (NOT (LISTP Y))
		 (EQUAL (LENGTH (ADDTOLIST Z Y))
			(ADD1 (LENGTH Y)))).

  This simplifies, applying CDR-CONS, and opening up ADDTOLIST, ADD1,
  LENGTH, and EQUAL, to:

        T.


     That finishes the proof of *1.1, which, consequently, also
finishes the proof of *1.  Q.E.D.


[ 1.80999756 0.487996418 ]

LENGTH-SORT 


(DEFN COUNT-LIST
      (A L)
      (IF (LISTP L)
	  (IF (EQUAL A (CAR L))
	      (ADD1 (COUNT-LIST A (CDR L)))
	      (COUNT-LIST A (CDR L)))
	  0.))
     Linear arithmetic and the lemma CDR-LESSP inform us that the
measure (COUNT L) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, COUNT-LIST is accepted under
the principle of definition.  Observe that (NUMBERP (COUNT-LIST A L))
is a theorem.




[ 0.135001628 0.0399943036 ]

COUNT-LIST 


(PROVE-LEMMA COUNT-LIST-SORT NIL
	     (EQUAL (COUNT-LIST A (SORT L))
		    (COUNT-LIST A L)))

     Call the conjecture *1.


     Perhaps we can prove it by induction.  There are two plausible
inductions.  However, they merge into one likely candidate induction.
We will induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP L)
			 (EQUAL A (CAR L))
			 (P A (CDR L)))
		    (P A L))
	   (IMPLIES (AND (LISTP L)
			 (NOT (EQUAL A (CAR L)))
			 (P A (CDR L)))
		    (P A L))
	   (IMPLIES (NOT (LISTP L)) (P A L))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT L) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
produces three new formulas:

Case 3. (IMPLIES (AND (LISTP L)
		      (EQUAL A (CAR L))
		      (EQUAL (COUNT-LIST A (SORT (CDR L)))
			     (COUNT-LIST A (CDR L))))
		 (EQUAL (COUNT-LIST A (SORT L))
			(COUNT-LIST A L))).

  This simplifies, expanding the definitions of SORT and COUNT-LIST,
  to:

        (IMPLIES
		(AND (LISTP L)
		     (EQUAL (COUNT-LIST (CAR L) (SORT (CDR L)))
			    (COUNT-LIST (CAR L) (CDR L))))
		(EQUAL (COUNT-LIST (CAR L)
				   (ADDTOLIST (CAR L) (SORT (CDR L))))
		       (ADD1 (COUNT-LIST (CAR L) (CDR L))))).

  Appealing to the lemma CAR-CDR-ELIM, we now replace L by (CONS X Z)
  to eliminate (CAR L) and (CDR L).  We would thus like to prove:

        (IMPLIES (EQUAL (COUNT-LIST X (SORT Z))
			(COUNT-LIST X Z))
		 (EQUAL (COUNT-LIST X (ADDTOLIST X (SORT Z)))
			(ADD1 (COUNT-LIST X Z)))).

  We now use the above equality hypothesis by substituting
  (COUNT-LIST X (SORT Z)) for (COUNT-LIST X Z) and throwing away the
  equality.  We would thus like to prove the new conjecture:

        (EQUAL (COUNT-LIST X (ADDTOLIST X (SORT Z)))
	       (ADD1 (COUNT-LIST X (SORT Z)))),

  which we generalize by replacing (SORT Z) by Y.  We thus obtain:

        (EQUAL (COUNT-LIST X (ADDTOLIST X Y))
	       (ADD1 (COUNT-LIST X Y))),

  which we will name *1.1.

Case 2. (IMPLIES (AND (LISTP L)
		      (NOT (EQUAL A (CAR L)))
		      (EQUAL (COUNT-LIST A (SORT (CDR L)))
			     (COUNT-LIST A (CDR L))))
		 (EQUAL (COUNT-LIST A (SORT L))
			(COUNT-LIST A L))),

  which simplifies, unfolding the functions SORT and COUNT-LIST, to
  the formula:

        (IMPLIES
		(AND (LISTP L)
		     (NOT (EQUAL A (CAR L)))
		     (EQUAL (COUNT-LIST A (SORT (CDR L)))
			    (COUNT-LIST A (CDR L))))
		(EQUAL (COUNT-LIST A
				   (ADDTOLIST (CAR L) (SORT (CDR L))))
		       (COUNT-LIST A (CDR L)))).

  Appealing to the lemma CAR-CDR-ELIM, we now replace L by (CONS X Z)
  to eliminate (CAR L) and (CDR L).  We would thus like to prove:

        (IMPLIES (AND (NOT (EQUAL A X))
		      (EQUAL (COUNT-LIST A (SORT Z))
			     (COUNT-LIST A Z)))
		 (EQUAL (COUNT-LIST A (ADDTOLIST X (SORT Z)))
			(COUNT-LIST A Z))).

  We use the above equality hypothesis by substituting
  (COUNT-LIST A (SORT Z)) for (COUNT-LIST A Z) and throwing away the
  equality.  This produces:

        (IMPLIES (NOT (EQUAL A X))
		 (EQUAL (COUNT-LIST A (ADDTOLIST X (SORT Z)))
			(COUNT-LIST A (SORT Z)))).

  We will try to prove the above formula by generalizing it,
  replacing (SORT Z) by Y.  We would thus like to prove the new
  formula:

        (IMPLIES (NOT (EQUAL A X))
		 (EQUAL (COUNT-LIST A (ADDTOLIST X Y))
			(COUNT-LIST A Y))).

  Name the above subgoal *1.2.

Case 1. (IMPLIES (NOT (LISTP L))
		 (EQUAL (COUNT-LIST A (SORT L))
			(COUNT-LIST A L))).

  This simplifies, expanding the definitions of SORT, LISTP,
  COUNT-LIST, and EQUAL, to:

        T.


     So next consider:

      (IMPLIES (NOT (EQUAL A X))
	       (EQUAL (COUNT-LIST A (ADDTOLIST X Y))
		      (COUNT-LIST A Y))),

which is formula *1.2 above.  We will appeal to induction.  There are
two plausible inductions.  However, they merge into one likely
candidate induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (AND (LISTP Y) (LESSP X (CAR Y)))
		    (P A X Y))
	   (IMPLIES (AND (LISTP Y)
			 ( LEQ (CAR Y) X)
			 (P A X (CDR Y)))
		    (P A X Y))
	   (IMPLIES (NOT (LISTP Y)) (P A X Y))).
Linear arithmetic and the lemma CDR-LESSP can be used to establish
that the measure (COUNT Y) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme generates three new conjectures:

Case 3. (IMPLIES (AND (LISTP Y)
		      (LESSP X (CAR Y))
		      (NOT (EQUAL A X)))
		 (EQUAL (COUNT-LIST A (ADDTOLIST X Y))
			(COUNT-LIST A Y))),

  which we simplify, opening up ADDTOLIST and COUNT-LIST, to two new
  conjectures:

  Case 3.2.
          (IMPLIES (AND (LISTP Y)
			(LESSP X (CAR Y))
			(NOT (EQUAL A X))
			(NOT (EQUAL A (CAR Y))))
		   (EQUAL (COUNT-LIST A (CONS X Y))
			  (COUNT-LIST A (CDR Y)))).

    However this again simplifies, applying CDR-CONS and CAR-CONS,
    and opening up the definition of COUNT-LIST, to:

          T.

  Case 3.1.
          (IMPLIES (AND (LISTP Y)
			(LESSP X (CAR Y))
			(NOT (EQUAL A X))
			(EQUAL A (CAR Y)))
		   (EQUAL (COUNT-LIST A (CONS X Y))
			  (ADD1 (COUNT-LIST A (CDR Y))))).

    But this again simplifies, applying CDR-CONS and CAR-CONS, and
    opening up the function COUNT-LIST, to:

          (IMPLIES (AND (LISTP Y)
			(LESSP X (CAR Y))
			(NOT (EQUAL (CAR Y) X)))
		   (EQUAL (COUNT-LIST (CAR Y) Y)
			  (ADD1 (COUNT-LIST (CAR Y) (CDR Y))))),

    which we again simplify, expanding the function COUNT-LIST, to:

          T.

Case 2. (IMPLIES (AND (LISTP Y)
		      ( LEQ (CAR Y) X)
		      (EQUAL (COUNT-LIST A (ADDTOLIST X (CDR Y)))
			     (COUNT-LIST A (CDR Y)))
		      (NOT (EQUAL A X)))
		 (EQUAL (COUNT-LIST A (ADDTOLIST X Y))
			(COUNT-LIST A Y))),

  which we simplify, applying the lemmas CDR-CONS and CAR-CONS, and
  opening up the definitions of ADDTOLIST and COUNT-LIST, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP Y))
		      (NOT (EQUAL A X)))
		 (EQUAL (COUNT-LIST A (ADDTOLIST X Y))
			(COUNT-LIST A Y))),

  which we simplify, appealing to the lemmas CDR-CONS and CAR-CONS,
  and unfolding the functions ADDTOLIST, COUNT-LIST, LISTP, and EQUAL,
  to:

        T.


     That finishes the proof of *1.2.


     So let us turn our attention to:

      (EQUAL (COUNT-LIST X (ADDTOLIST X Y))
	     (ADD1 (COUNT-LIST X Y))),

named *1.1 above.  We will appeal to induction.  There are two
plausible inductions.  However, they merge into one likely candidate
induction.  We will induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP Y) (LESSP X (CAR Y)))
		    (P X Y))
	   (IMPLIES (AND (LISTP Y)
			 ( LEQ (CAR Y) X)
			 (P X (CDR Y)))
		    (P X Y))
	   (IMPLIES (NOT (LISTP Y)) (P X Y))).
Linear arithmetic and the lemma CDR-LESSP can be used to show that
the measure (COUNT Y) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme generates the following three new conjectures:

Case 3. (IMPLIES (AND (LISTP Y) (LESSP X (CAR Y)))
		 (EQUAL (COUNT-LIST X (ADDTOLIST X Y))
			(ADD1 (COUNT-LIST X Y)))).

  This simplifies, unfolding the definitions of ADDTOLIST and
  COUNT-LIST, to the following two new conjectures:

  Case 3.2.
          (IMPLIES (AND (LISTP Y)
			(LESSP X (CAR Y))
			(NOT (EQUAL X (CAR Y))))
		   (EQUAL (COUNT-LIST X (CONS X Y))
			  (ADD1 (COUNT-LIST X (CDR Y))))),

    which we again simplify, applying CDR-CONS and CAR-CONS, and
    expanding the function COUNT-LIST, to:

          T.

  Case 3.1.
          (IMPLIES (AND (LISTP Y)
			(LESSP X (CAR Y))
			(EQUAL X (CAR Y)))
		   (EQUAL (COUNT-LIST X (CONS X Y))
			  (ADD1 (ADD1 (COUNT-LIST X (CDR Y)))))),

    which again simplifies, using linear arithmetic, to:

          T.

Case 2. (IMPLIES (AND (LISTP Y)
		      ( LEQ (CAR Y) X)
		      (EQUAL (COUNT-LIST X (ADDTOLIST X (CDR Y)))
			     (ADD1 (COUNT-LIST X (CDR Y)))))
		 (EQUAL (COUNT-LIST X (ADDTOLIST X Y))
			(ADD1 (COUNT-LIST X Y)))),

  which simplifies, applying CDR-CONS and CAR-CONS, and unfolding
  ADDTOLIST and COUNT-LIST, to:

        T.

Case 1. (IMPLIES (NOT (LISTP Y))
		 (EQUAL (COUNT-LIST X (ADDTOLIST X Y))
			(ADD1 (COUNT-LIST X Y)))).

  This simplifies, rewriting with the lemmas CDR-CONS and CAR-CONS,
  and expanding the functions ADDTOLIST, COUNT-LIST, LISTP, ADD1, and
  EQUAL, to:

        T.


     That finishes the proof of *1.1, which also finishes the proof
of *1.  Q.E.D.


[ 6.1979899 1.04201253 ]

COUNT-LIST-SORT 


(PROVE-LEMMA ORDERED-APPEND NIL
	     (IMPLIES (ORDERED (APPEND A B))
		      (ORDERED A)))

     Name the conjecture *1.


     We will try to prove it by induction.  There are two plausible
inductions.  However, they merge into one likely candidate induction.
We will induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP A) (P (CDR A) B))
		    (P A B))
	   (IMPLIES (NOT (LISTP A)) (P A B))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT A) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
generates the following three new formulas:

Case 3. (IMPLIES (AND (LISTP A)
		      (NOT (ORDERED (APPEND (CDR A) B)))
		      (ORDERED (APPEND A B)))
		 (ORDERED A)),

  which simplifies, applying CAR-CONS and CDR-CONS, and expanding the
  definitions of APPEND and ORDERED, to two new formulas:

  Case 3.2.
          (IMPLIES (AND (LISTP A)
			(NOT (ORDERED (APPEND (CDR A) B)))
			(NOT (LISTP (APPEND (CDR A) B)))
			(LISTP (CDR A)))
		   (ORDERED (CDR A))),

    which we again simplify, unfolding ORDERED, to:

          T.

  Case 3.1.
          (IMPLIES (AND (LISTP A)
			(NOT (ORDERED (APPEND (CDR A) B)))
			(NOT (LISTP (APPEND (CDR A) B)))
			(LISTP (CDR A)))
		   ( LEQ (CAR A) (CADR A))).

    But this again simplifies, unfolding the definition of ORDERED,
    to:

          T.

Case 2. (IMPLIES (AND (LISTP A)
		      (ORDERED (CDR A))
		      (ORDERED (APPEND A B)))
		 (ORDERED A)),

  which we simplify, rewriting with CAR-CONS and CDR-CONS, and
  opening up APPEND and ORDERED, to two new conjectures:

  Case 2.2.
          (IMPLIES (AND (LISTP A)
			(ORDERED (CDR A))
			(NOT (LISTP (APPEND (CDR A) B)))
			(LISTP (CDR A)))
		   ( LEQ (CAR A) (CADR A))).

    Applying the lemma CAR-CDR-ELIM, we now replace A by (CONS Z X)
    to eliminate (CDR A) and (CAR A) and X by (CONS V W) to eliminate
    (CAR X) and (CDR X).  We thus obtain:

          (IMPLIES (AND (ORDERED (CONS V W))
			(NOT (LISTP (APPEND (CONS V W) B))))
		   ( LEQ Z V)),

    which further simplifies, applying CAR-CONS and CDR-CONS, and
    expanding ORDERED and APPEND, to:

          T.

  Case 2.1.
          (IMPLIES (AND (LISTP A)
			(ORDERED (CDR A))
			( LEQ
			  (CAR A)
			  (CAR (APPEND (CDR A) B)))
			(ORDERED (APPEND (CDR A) B))
			(LISTP (CDR A)))
		   ( LEQ (CAR A) (CADR A))).

    Applying the lemma CAR-CDR-ELIM, replace A by (CONS Z X) to
    eliminate (CDR A) and (CAR A) and X by (CONS V W) to eliminate
    (CAR X) and (CDR X).  This generates:

          (IMPLIES (AND (ORDERED (CONS V W))
			( LEQ Z (CAR (APPEND (CONS V W) B)))
			(ORDERED (APPEND (CONS V W) B)))
		   ( LEQ Z V)).

    But this simplifies further, rewriting with CAR-CONS and CDR-CONS,
    and expanding the functions ORDERED and APPEND, to:

          T.

Case 1. (IMPLIES (AND (NOT (LISTP A))
		      (ORDERED (APPEND A B)))
		 (ORDERED A)).

  This simplifies, unfolding the functions APPEND and ORDERED, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 3.0360026 0.398994956 ]

ORDERED-APPEND 


(PROVE-LEMMA LEQ-HALF NIL
	     (LEQ (HALF I) I))

     Call the conjecture *1.


     Perhaps we can prove it by induction.  There are two plausible
inductions, both of which are unflawed.  However, one of these is
more likely than the other.  We will induct according to the
following scheme:
      (AND (IMPLIES (ZEROP I) (P I))
	   (IMPLIES (AND (NOT (ZEROP I)) (ZEROP (SUB1 I)))
		    (P I))
	   (IMPLIES (AND (NOT (ZEROP I))
			 (NOT (ZEROP (SUB1 I)))
			 (P (SUB1 (SUB1 I))))
		    (P I))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP establish that the measure (COUNT I) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme generates the following three new formulas:

Case 3. (IMPLIES (ZEROP I) ( LEQ (HALF I) I)).

  This simplifies, expanding ZEROP, HALF, LESSP, and EQUAL, to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP I)) (ZEROP (SUB1 I)))
		 ( LEQ (HALF I) I)).

  This simplifies, opening up the definitions of ZEROP, HALF, EQUAL,
  and LESSP, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP I))
		      (NOT (ZEROP (SUB1 I)))
		      ( LEQ
			(HALF (SUB1 (SUB1 I)))
			(SUB1 (SUB1 I))))
		 ( LEQ (HALF I) I)),

  which we simplify, rewriting with the lemma SUB1-ADD1, and
  unfolding the functions ZEROP, HALF, and LESSP, to:

        (IMPLIES (AND (NOT (EQUAL I 0))
		      (NUMBERP I)
		      (NOT (EQUAL (SUB1 I) 0))
		      ( LEQ
			(HALF (SUB1 (SUB1 I)))
			(SUB1 (SUB1 I))))
		 ( LEQ
		   (HALF (SUB1 (SUB1 I)))
		   (SUB1 I))),

  which again simplifies, using linear arithmetic, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.475 0.23100179 ]

LEQ-HALF 


(DEFN NUMBER-LISTP
      (L)
      (IF (LISTP L)
	  (IF (NUMBERP (CAR L))
	      (NUMBER-LISTP (CDR L))
	      F)
	  (EQUAL L NIL)))
     Linear arithmetic and the lemma CDR-LESSP can be used to
establish that the measure (COUNT L) decreases according to the
well-founded relation LESSP in each recursive call.  Hence,
NUMBER-LISTP is accepted under the definitional principle.  Observe
that (OR (FALSEP (NUMBER-LISTP L)) (TRUEP (NUMBER-LISTP L))) is a
theorem.




[ 0.0880004885 0.0449991864 ]

NUMBER-LISTP 


(PROVE-LEMMA ORDERED-SORT
	     (REWRITE)
	     (ORDERED (SORT X)))

     Give the conjecture the name *1.


     Let us appeal to the induction principle.  There is only one
suggested induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (AND (LISTP X) (P (CDR X)))
		    (P X))
	   (IMPLIES (NOT (LISTP X)) (P X))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
generates two new conjectures:

Case 2. (IMPLIES (AND (LISTP X)
		      (ORDERED (SORT (CDR X))))
		 (ORDERED (SORT X))),

  which simplifies, opening up the definition of SORT, to:

        (IMPLIES (AND (LISTP X)
		      (ORDERED (SORT (CDR X))))
		 (ORDERED (ADDTOLIST (CAR X) (SORT (CDR X))))).

  Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS V Z)
  to eliminate (CDR X) and (CAR X).  This generates:

        (IMPLIES (ORDERED (SORT Z))
		 (ORDERED (ADDTOLIST V (SORT Z)))),

  which we generalize by replacing (SORT Z) by Y.  We would thus like
  to prove the formula:

        (IMPLIES (ORDERED Y)
		 (ORDERED (ADDTOLIST V Y))),

  which we will name *1.1.

Case 1. (IMPLIES (NOT (LISTP X))
		 (ORDERED (SORT X))).

  This simplifies, opening up the functions SORT and ORDERED, to:

        T.


     So next consider:

      (IMPLIES (ORDERED Y)
	       (ORDERED (ADDTOLIST V Y))),

which is formula *1.1 above.  Perhaps we can prove it by induction.
The recursive terms in the conjecture suggest two inductions.
However, they merge into one likely candidate induction.  We will
induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP Y)
			 (LISTP (CDR Y))
			 (LESSP (CADR Y) (CAR Y)))
		    (P V Y))
	   (IMPLIES (AND (LISTP Y)
			 (LISTP (CDR Y))
			 ( LEQ (CAR Y) (CADR Y))
			 (P V (CDR Y)))
		    (P V Y))
	   (IMPLIES (AND (LISTP Y) (NOT (LISTP (CDR Y))))
		    (P V Y))
	   (IMPLIES (NOT (LISTP Y)) (P V Y))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme leads
to five new formulas:

Case 5. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      (LESSP (CADR Y) (CAR Y))
		      (ORDERED Y))
		 (ORDERED (ADDTOLIST V Y))),

  which simplifies, expanding the definition of ORDERED, to:

        T.

Case 4. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CAR Y) (CADR Y))
		      (NOT (ORDERED (CDR Y)))
		      (ORDERED Y))
		 (ORDERED (ADDTOLIST V Y))),

  which we simplify, unfolding ORDERED, to:

        T.

Case 3. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CAR Y) (CADR Y))
		      (ORDERED (ADDTOLIST V (CDR Y)))
		      (ORDERED Y))
		 (ORDERED (ADDTOLIST V Y))),

  which simplifies, unfolding the definitions of ORDERED and
  ADDTOLIST, to the following two new goals:

  Case 3.2.
          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CAR Y) (CADR Y))
			(ORDERED (ADDTOLIST V (CDR Y)))
			(ORDERED (CDR Y))
			( LEQ (CAR Y) V))
		   (ORDERED (CONS (CAR Y)
				  (ADDTOLIST V (CDR Y))))),

    which again simplifies, rewriting with the lemmas CAR-CONS and
    CDR-CONS, and unfolding the definition of ORDERED, to the formula:

          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CAR Y) (CADR Y))
			(ORDERED (ADDTOLIST V (CDR Y)))
			(ORDERED (CDR Y))
			( LEQ (CAR Y) V))
		   ( LEQ
		     (CAR Y)
		     (CAR (ADDTOLIST V (CDR Y))))).

    Applying the lemma CAR-CDR-ELIM, we now replace Y by (CONS Z X)
    to eliminate (CDR Y) and (CAR Y) and X by (CONS W D) to eliminate
    (CAR X) and (CDR X).  We must thus prove:

          (IMPLIES (AND ( LEQ Z W)
			(ORDERED (ADDTOLIST V (CONS W D)))
			(ORDERED (CONS W D))
			( LEQ Z V))
		   ( LEQ Z
		     (CAR (ADDTOLIST V (CONS W D))))),

    which further simplifies, rewriting with CDR-CONS and CAR-CONS,
    and expanding the definitions of ADDTOLIST and ORDERED, to:

          T.

  Case 3.1.
          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CAR Y) (CADR Y))
			(ORDERED (ADDTOLIST V (CDR Y)))
			(ORDERED (CDR Y))
			(LESSP V (CAR Y)))
		   (ORDERED (CONS V Y))).

    This again simplifies, rewriting with the lemmas CAR-CONS and
    CDR-CONS, and expanding the function ORDERED, to the goal:

          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CAR Y) (CADR Y))
			(ORDERED (ADDTOLIST V (CDR Y)))
			(ORDERED (CDR Y))
			(LESSP V (CAR Y)))
		   ( LEQ V (CAR Y))),

    which we again simplify, using linear arithmetic, to:

          T.

Case 2. (IMPLIES (AND (LISTP Y)
		      (NOT (LISTP (CDR Y)))
		      (ORDERED Y))
		 (ORDERED (ADDTOLIST V Y))),

  which we simplify, opening up the functions ORDERED and ADDTOLIST,
  to two new goals:

  Case 2.2.
          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			( LEQ (CAR Y) V))
		   (ORDERED (CONS (CAR Y)
				  (ADDTOLIST V (CDR Y))))),

    which we again simplify, rewriting with CAR-CONS and CDR-CONS,
    and opening up the function ORDERED, to two new goals:

    Case 2.2.2.
            (IMPLIES (AND (LISTP Y)
			  (NOT (LISTP (CDR Y)))
			  ( LEQ (CAR Y) V))
		     ( LEQ
		       (CAR Y)
		       (CAR (ADDTOLIST V (CDR Y))))).

      But this further simplifies, rewriting with the lemma CAR-CONS,
      and expanding the definition of ADDTOLIST, to:

            T.

    Case 2.2.1.
            (IMPLIES (AND (LISTP Y)
			  (NOT (LISTP (CDR Y)))
			  ( LEQ (CAR Y) V))
		     (ORDERED (ADDTOLIST V (CDR Y)))).

      This further simplifies, rewriting with the lemma CDR-CONS, and
      expanding the functions ADDTOLIST, LISTP, and ORDERED, to:

            T.

  Case 2.1.
          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(LESSP V (CAR Y)))
		   (ORDERED (CONS V Y))),

    which we again simplify, applying the lemmas CAR-CONS and
    CDR-CONS, and expanding the function ORDERED, to the formula:

          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(LESSP V (CAR Y)))
		   ( LEQ V (CAR Y))).

    This simplifies again, using linear arithmetic, to:

          T.

Case 1. (IMPLIES (AND (NOT (LISTP Y)) (ORDERED Y))
		 (ORDERED (ADDTOLIST V Y))).

  This simplifies, appealing to the lemma CDR-CONS, and unfolding the
  definitions of ORDERED, ADDTOLIST, and LISTP, to:

        T.


     That finishes the proof of *1.1, which, in turn, finishes the
proof of *1.  Q.E.D.


[ 6.6669922 0.839009605 ]

ORDERED-SORT 


(PROVE-LEMMA ADDTOLIST-OF-ORDERED-NUMBER-LIST
	     (REWRITE)
	     (IMPLIES (AND (ORDERED X)
			   (NUMBER-LISTP X)
			   (NUMBERP I)
			   ( LEQ I (CAR X)))
		      (EQUAL (ADDTOLIST I X) (CONS I X))))
.

Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V) to
eliminate (CAR X) and (CDR X).  The result is two new goals:

Case 2. (IMPLIES (AND (NOT (LISTP X))
		      (ORDERED X)
		      (NUMBER-LISTP X)
		      (NUMBERP I)
		      ( LEQ I (CAR X)))
		 (EQUAL (ADDTOLIST I X) (CONS I X))),

  which we simplify, unfolding ORDERED, NUMBER-LISTP, CAR, EQUAL,
  LESSP, ADDTOLIST, and CONS, to:

        T.

Case 1. (IMPLIES (AND (ORDERED (CONS Z V))
		      (NUMBER-LISTP (CONS Z V))
		      (NUMBERP I)
		      ( LEQ I Z))
		 (EQUAL (ADDTOLIST I (CONS Z V))
			(CONS I (CONS Z V)))),

  which simplifies, applying CAR-CONS and CDR-CONS, and expanding the
  definitions of ORDERED, NUMBER-LISTP, ADDTOLIST, and LISTP, to two
  new formulas:

  Case 1.2.
          (IMPLIES (AND (NOT (LISTP V))
			(NUMBERP Z)
			(EQUAL V NIL)
			(NUMBERP I)
			( LEQ I Z)
			( LEQ Z I))
		   (EQUAL (LIST Z I) (LIST I Z))),

    which we again simplify, using linear arithmetic, to:

          (IMPLIES (AND (NOT (LISTP NIL))
			(NUMBERP I)
			(NUMBERP I)
			( LEQ I I)
			( LEQ I I))
		   (EQUAL (LIST I I) (LIST I I))),

    which again simplifies, trivially, to:

          T.

  Case 1.1.
          (IMPLIES (AND ( LEQ Z (CAR V))
			(ORDERED V)
			(NUMBERP Z)
			(NUMBER-LISTP V)
			(NUMBERP I)
			( LEQ I Z)
			( LEQ Z I))
		   (EQUAL (CONS Z (ADDTOLIST I V))
			  (CONS I (CONS Z V)))).

    However this again simplifies, using linear arithmetic, to:

          (IMPLIES (AND ( LEQ I (CAR V))
			(ORDERED V)
			(NUMBERP I)
			(NUMBER-LISTP V)
			(NUMBERP I)
			( LEQ I I)
			( LEQ I I))
		   (EQUAL (CONS I (ADDTOLIST I V))
			  (CONS I (CONS I V)))),

    which we again simplify, rewriting with the lemmas CAR-CONS,
    CDR-CONS, and CONS-EQUAL, to:

          (IMPLIES (AND ( LEQ I (CAR V))
			(ORDERED V)
			(NUMBER-LISTP V)
			(NUMBERP I)
			( LEQ I I))
		   (EQUAL (ADDTOLIST I V) (CONS I V))),

    which we would usually push and work on later by induction.  But
    if we must use induction to prove the input conjecture, we prefer
    to induct on the original formulation of the problem.  Thus we
    will disregard all that we have previously done, give the name *1
    to the original input, and work on it.


     So now let us consider:

(IMPLIES (AND (ORDERED X)
	      (NUMBER-LISTP X)
	      (NUMBERP I)
	      ( LEQ I (CAR X)))
	 (EQUAL (ADDTOLIST I X) (CONS I X))),

named *1 above.  Let us appeal to the induction principle.  The
recursive terms in the conjecture suggest four inductions.  They
merge into two likely candidate inductions.  However, only one is
unflawed.  We will induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP X)
			 (LISTP (CDR X))
			 (LESSP (CADR X) (CAR X)))
		    (P I X))
	   (IMPLIES (AND (LISTP X)
			 (LISTP (CDR X))
			 ( LEQ (CAR X) (CADR X))
			 (P I (CDR X)))
		    (P I X))
	   (IMPLIES (AND (LISTP X) (NOT (LISTP (CDR X))))
		    (P I X))
	   (IMPLIES (NOT (LISTP X)) (P I X))).
Linear arithmetic and the lemma CDR-LESSP can be used to show that
the measure (COUNT X) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme generates seven new conjectures:

Case 7. (IMPLIES (AND (LISTP X)
		      (LISTP (CDR X))
		      (LESSP (CADR X) (CAR X))
		      (ORDERED X)
		      (NUMBER-LISTP X)
		      (NUMBERP I)
		      ( LEQ I (CAR X)))
		 (EQUAL (ADDTOLIST I X) (CONS I X))).

  This simplifies, unfolding the definition of ORDERED, to:

        T.

Case 6. (IMPLIES (AND (LISTP X)
		      (LISTP (CDR X))
		      ( LEQ (CAR X) (CADR X))
		      (NOT (ORDERED (CDR X)))
		      (ORDERED X)
		      (NUMBER-LISTP X)
		      (NUMBERP I)
		      ( LEQ I (CAR X)))
		 (EQUAL (ADDTOLIST I X) (CONS I X))),

  which we simplify, unfolding the definition of ORDERED, to:

        T.

Case 5. (IMPLIES (AND (LISTP X)
		      (LISTP (CDR X))
		      ( LEQ (CAR X) (CADR X))
		      (NOT (NUMBER-LISTP (CDR X)))
		      (ORDERED X)
		      (NUMBER-LISTP X)
		      (NUMBERP I)
		      ( LEQ I (CAR X)))
		 (EQUAL (ADDTOLIST I X) (CONS I X))),

  which simplifies, unfolding ORDERED and NUMBER-LISTP, to:

        T.

Case 4. (IMPLIES (AND (LISTP X)
		      (LISTP (CDR X))
		      ( LEQ (CAR X) (CADR X))
		      (LESSP (CADR X) I)
		      (ORDERED X)
		      (NUMBER-LISTP X)
		      (NUMBERP I)
		      ( LEQ I (CAR X)))
		 (EQUAL (ADDTOLIST I X) (CONS I X))),

  which simplifies, using linear arithmetic, to:

        T.

Case 3. (IMPLIES (AND (LISTP X)
		      (LISTP (CDR X))
		      ( LEQ (CAR X) (CADR X))
		      (EQUAL (ADDTOLIST I (CDR X))
			     (CONS I (CDR X)))
		      (ORDERED X)
		      (NUMBER-LISTP X)
		      (NUMBERP I)
		      ( LEQ I (CAR X)))
		 (EQUAL (ADDTOLIST I X) (CONS I X))),

  which we simplify, rewriting with the lemma CAR-CONS, and expanding
  the definitions of ORDERED, NUMBER-LISTP, and ADDTOLIST, to the new
  goal:

        (IMPLIES (AND (LISTP X)
		      (LISTP (CDR X))
		      ( LEQ (CAR X) (CADR X))
		      (EQUAL (ADDTOLIST I (CDR X))
			     (CONS I (CDR X)))
		      (ORDERED (CDR X))
		      (NUMBERP (CAR X))
		      (NUMBER-LISTP (CDR X))
		      (NUMBERP I)
		      ( LEQ I (CAR X))
		      ( LEQ (CAR X) I))
		 (EQUAL (CONS (CAR X) (ADDTOLIST I (CDR X)))
			(CONS I X))),

  which again simplifies, using linear arithmetic, to:

        (IMPLIES (AND (LISTP X)
		      (LISTP (CDR X))
		      ( LEQ (CAR X) (CADR X))
		      (EQUAL (ADDTOLIST (CAR X) (CDR X))
			     (CONS (CAR X) (CDR X)))
		      (ORDERED (CDR X))
		      (NUMBERP (CAR X))
		      (NUMBER-LISTP (CDR X))
		      (NUMBERP (CAR X))
		      ( LEQ (CAR X) (CAR X))
		      ( LEQ (CAR X) (CAR X)))
		 (EQUAL (CONS (CAR X)
			      (ADDTOLIST (CAR X) (CDR X)))
			(CONS (CAR X) X))),

  which again simplifies, applying CONS-CAR-CDR, to:

        T.

Case 2. (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CDR X)))
		      (ORDERED X)
		      (NUMBER-LISTP X)
		      (NUMBERP I)
		      ( LEQ I (CAR X)))
		 (EQUAL (ADDTOLIST I X) (CONS I X))),

  which we simplify, applying CAR-CONS, and opening up the
  definitions of ORDERED, NUMBER-LISTP, and ADDTOLIST, to the new
  conjecture:

        (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CDR X)))
		      (NUMBERP (CAR X))
		      (NUMBER-LISTP (CDR X))
		      (NUMBERP I)
		      ( LEQ I (CAR X))
		      ( LEQ (CAR X) I))
		 (EQUAL (CONS (CAR X) (ADDTOLIST I (CDR X)))
			(CONS I X))),

  which we again simplify, using linear arithmetic, to:

        (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CDR X)))
		      (NUMBERP (CAR X))
		      (NUMBER-LISTP (CDR X))
		      (NUMBERP (CAR X))
		      ( LEQ (CAR X) (CAR X))
		      ( LEQ (CAR X) (CAR X)))
		 (EQUAL (CONS (CAR X)
			      (ADDTOLIST (CAR X) (CDR X)))
			(CONS (CAR X) X))),

  which we again simplify, rewriting with the lemmas CAR-CONS,
  CDR-CONS, and CONS-EQUAL, and opening up the definition of
  ADDTOLIST, to the goal:

        (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CDR X)))
		      (NUMBER-LISTP (CDR X))
		      (NUMBERP (CAR X))
		      ( LEQ (CAR X) (CAR X)))
		 (EQUAL (LIST (CAR X)) X)),

  which further simplifies, applying CAR-CONS and CDR-CONS, and
  unfolding the definitions of NUMBER-LISTP and EQUAL, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP X))
		      (ORDERED X)
		      (NUMBER-LISTP X)
		      (NUMBERP I)
		      ( LEQ I (CAR X)))
		 (EQUAL (ADDTOLIST I X) (CONS I X))).

  This simplifies, unfolding the definitions of ORDERED, NUMBER-LISTP,
  CAR, EQUAL, LESSP, ADDTOLIST, and CONS, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 4.2289836 1.75501302 ]

ADDTOLIST-OF-ORDERED-NUMBER-LIST 


(PROVE-LEMMA SORT-OF-ORDERED-NUMBER-LIST
	     (REWRITE)
	     (IMPLIES (AND (ORDERED X) (NUMBER-LISTP X))
		      (EQUAL (SORT X) X)))

     Give the conjecture the name *1.


     Let us appeal to the induction principle.  The recursive terms
in the conjecture suggest three inductions.  However, they merge into
one likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (LISTP X)
			 (LISTP (CDR X))
			 (LESSP (CADR X) (CAR X)))
		    (P X))
	   (IMPLIES (AND (LISTP X)
			 (LISTP (CDR X))
			 ( LEQ (CAR X) (CADR X))
			 (P (CDR X)))
		    (P X))
	   (IMPLIES (AND (LISTP X) (NOT (LISTP (CDR X))))
		    (P X))
	   (IMPLIES (NOT (LISTP X)) (P X))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
generates six new conjectures:

Case 6. (IMPLIES (AND (LISTP X)
		      (LISTP (CDR X))
		      (LESSP (CADR X) (CAR X))
		      (ORDERED X)
		      (NUMBER-LISTP X))
		 (EQUAL (SORT X) X)),

  which simplifies, opening up the definition of ORDERED, to:

        T.

Case 5. (IMPLIES (AND (LISTP X)
		      (LISTP (CDR X))
		      ( LEQ (CAR X) (CADR X))
		      (NOT (ORDERED (CDR X)))
		      (ORDERED X)
		      (NUMBER-LISTP X))
		 (EQUAL (SORT X) X)).

  This simplifies, expanding the function ORDERED, to:

        T.

Case 4. (IMPLIES (AND (LISTP X)
		      (LISTP (CDR X))
		      ( LEQ (CAR X) (CADR X))
		      (NOT (NUMBER-LISTP (CDR X)))
		      (ORDERED X)
		      (NUMBER-LISTP X))
		 (EQUAL (SORT X) X)),

  which we simplify, expanding the functions ORDERED and NUMBER-LISTP,
  to:

        T.

Case 3. (IMPLIES (AND (LISTP X)
		      (LISTP (CDR X))
		      ( LEQ (CAR X) (CADR X))
		      (EQUAL (SORT (CDR X)) (CDR X))
		      (ORDERED X)
		      (NUMBER-LISTP X))
		 (EQUAL (SORT X) X)).

  This simplifies, rewriting with the lemmas CONS-CAR-CDR and
  ADDTOLIST-OF-ORDERED-NUMBER-LIST, and unfolding the functions
  ORDERED, NUMBER-LISTP, and SORT, to:

        T.

Case 2. (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CDR X)))
		      (ORDERED X)
		      (NUMBER-LISTP X))
		 (EQUAL (SORT X) X)).

  This simplifies, unfolding the definitions of ORDERED, NUMBER-LISTP,
  and SORT, to:

        (IMPLIES (AND (LISTP X)
		      (NOT (LISTP (CDR X)))
		      (NUMBERP (CAR X))
		      (NUMBER-LISTP (CDR X)))
		 (EQUAL (ADDTOLIST (CAR X) (SORT (CDR X)))
			X)),

  which we further simplify, rewriting with the lemmas CAR-CONS and
  CDR-CONS, and expanding the definitions of NUMBER-LISTP, SORT,
  LISTP, ADDTOLIST, and EQUAL, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP X))
		      (ORDERED X)
		      (NUMBER-LISTP X))
		 (EQUAL (SORT X) X)),

  which we simplify, opening up ORDERED, NUMBER-LISTP, SORT, and
  EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.60700276 0.35999349 ]

SORT-OF-ORDERED-NUMBER-LIST 


(DEFN XOR
      (P Q)
      (IF Q (IF P F T) (EQUAL P T)))
     Note that (OR (FALSEP (XOR P Q)) (TRUEP (XOR P Q))) is a theorem.




[ 0.031998698 0.0110066732 ]

XOR 


(PROVE-LEMMA CROCK-DUE-TO-LACK-OF-BOUNCE
	     (REWRITE)
	     (IMPLIES (EQUAL X (SORT L))
		      (ORDERED X)))

WARNING:  Note that CROCK-DUE-TO-LACK-OF-BOUNCE contains the free
variable L which will be chosen by instantiating the hypothesis
(EQUAL X (SORT L)).

This conjecture simplifies, rewriting with ORDERED-SORT, to:

      T.

Q.E.D.


[ 0.35600179 0.0150024414 ]

CROCK-DUE-TO-LACK-OF-BOUNCE 


(PROVE-LEMMA SORT-ORDERED
	     (REWRITE)
	     (IMPLIES (NUMBER-LISTP L)
		      (EQUAL (EQUAL (SORT L) L)
			     (ORDERED L))))
This formula simplifies, obviously, to the following two new goals:

Case 2. (IMPLIES (AND (NUMBER-LISTP L)
		      (NOT (EQUAL (SORT L) L)))
		 (NOT (ORDERED L))),

  which we again simplify, applying SORT-OF-ORDERED-NUMBER-LIST, to:

        T.

Case 1. (IMPLIES (AND (NUMBER-LISTP L)
		      (EQUAL (SORT L) L))
		 (EQUAL (ORDERED L) T)),

  which again simplifies, applying the lemma
  CROCK-DUE-TO-LACK-OF-BOUNCE, and unfolding EQUAL, to:

        T.

Q.E.D.


[ 1.62800293 0.061999512 ]

SORT-ORDERED 


(DEFN SUBST
      (X Y Z)
      (IF (EQUAL Y Z)
	  X
	  (IF (LISTP Z)
	      (CONS (SUBST X Y (CAR Z))
		    (SUBST X Y (CDR Z)))
	      Z)))
     Linear arithmetic and the lemmas CDR-LESSP and CAR-LESSP
establish that the measure (COUNT Z) decreases according to the
well-founded relation LESSP in each recursive call.  Hence, SUBST is
accepted under the definitional principle.  From the definition we
can conclude that:
      (OR (LISTP (SUBST X Y Z))
	  (EQUAL (SUBST X Y Z) X)
	  (EQUAL (SUBST X Y Z) Z))
is a theorem.




[ 0.128995769 0.052006022 ]

SUBST 


(PROVE-LEMMA SUBST-A-A NIL
	     (EQUAL (SUBST A A B) B))

     Give the conjecture the name *1.


     We will try to prove it by induction.  There is only one
plausible induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (EQUAL A B) (P A B))
	   (IMPLIES (AND (NOT (EQUAL A B))
			 (LISTP B)
			 (P A (CDR B))
			 (P A (CAR B)))
		    (P A B))
	   (IMPLIES (AND (NOT (EQUAL A B))
			 (NOT (LISTP B)))
		    (P A B))).
Linear arithmetic and the lemmas CDR-LESSP and CAR-LESSP establish
that the measure (COUNT B) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme leads to the following three new goals:

Case 3. (IMPLIES (EQUAL A B)
		 (EQUAL (SUBST A A B) B)),

  which simplifies, unfolding the definition of SUBST, to:

        T.

Case 2. (IMPLIES (AND (NOT (EQUAL A B))
		      (LISTP B)
		      (EQUAL (SUBST A A (CDR B)) (CDR B))
		      (EQUAL (SUBST A A (CAR B)) (CAR B)))
		 (EQUAL (SUBST A A B) B)).

  This simplifies, applying CONS-CAR-CDR, and expanding the function
  SUBST, to:

        T.

Case 1. (IMPLIES (AND (NOT (EQUAL A B))
		      (NOT (LISTP B)))
		 (EQUAL (SUBST A A B) B)).

  This simplifies, opening up SUBST, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.240002442 0.182999674 ]

SUBST-A-A 


(DEFN OCCUR
      (X Y)
      (IF (EQUAL X Y)
	  T
	  (IF (LISTP Y)
	      (IF (OCCUR X (CAR Y))
		  T
		  (OCCUR X (CDR Y)))
	      F)))
     Linear arithmetic and the lemmas CAR-LESSP and CDR-LESSP inform
us that the measure (COUNT Y) decreases according to the well-founded
relation LESSP in each recursive call.  Hence, OCCUR is accepted
under the principle of definition.  Observe that:
      (OR (FALSEP (OCCUR X Y))
	  (TRUEP (OCCUR X Y)))
is a theorem.




[ 0.128999837 0.0470011393 ]

OCCUR 


(PROVE-LEMMA OCCUR-SUBST NIL
	     (IMPLIES (NOT (OCCUR A B))
		      (EQUAL (SUBST C A B) B)))

     Give the conjecture the name *1.


     Let us appeal to the induction principle.  The recursive terms
in the conjecture suggest two inductions.  However, they merge into
one likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (EQUAL A B) (P C A B))
	   (IMPLIES (AND (NOT (EQUAL A B))
			 (LISTP B)
			 (OCCUR A (CAR B))
			 (P C A (CAR B)))
		    (P C A B))
	   (IMPLIES (AND (NOT (EQUAL A B))
			 (LISTP B)
			 (NOT (OCCUR A (CAR B)))
			 (P C A (CDR B))
			 (P C A (CAR B)))
		    (P C A B))
	   (IMPLIES (AND (NOT (EQUAL A B))
			 (NOT (LISTP B)))
		    (P C A B))).
Linear arithmetic and the lemmas CAR-LESSP and CDR-LESSP inform us
that the measure (COUNT B) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme generates five new conjectures:

Case 5. (IMPLIES (AND (EQUAL A B) (NOT (OCCUR A B)))
		 (EQUAL (SUBST C A B) B)),

  which simplifies, opening up the definition of OCCUR, to:

        T.

Case 4. (IMPLIES (AND (NOT (EQUAL A B))
		      (LISTP B)
		      (OCCUR A (CAR B))
		      (NOT (OCCUR A B)))
		 (EQUAL (SUBST C A B) B)).

  This simplifies, expanding the function OCCUR, to:

        T.

Case 3. (IMPLIES (AND (NOT (EQUAL A B))
		      (LISTP B)
		      (NOT (OCCUR A (CAR B)))
		      (OCCUR A (CDR B))
		      (EQUAL (SUBST C A (CAR B)) (CAR B))
		      (NOT (OCCUR A B)))
		 (EQUAL (SUBST C A B) B)),

  which we simplify, expanding the function OCCUR, to:

        T.

Case 2. (IMPLIES (AND (NOT (EQUAL A B))
		      (LISTP B)
		      (NOT (OCCUR A (CAR B)))
		      (EQUAL (SUBST C A (CDR B)) (CDR B))
		      (EQUAL (SUBST C A (CAR B)) (CAR B))
		      (NOT (OCCUR A B)))
		 (EQUAL (SUBST C A B) B)).

  This simplifies, rewriting with the lemma CONS-CAR-CDR, and
  unfolding the functions OCCUR and SUBST, to:

        T.

Case 1. (IMPLIES (AND (NOT (EQUAL A B))
		      (NOT (LISTP B))
		      (NOT (OCCUR A B)))
		 (EQUAL (SUBST C A B) B)).

  This simplifies, unfolding the definitions of OCCUR and SUBST, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.521993004 0.29300537 ]

OCCUR-SUBST 


(DEFN COUNTPS-LOOP
      (L PRED ANS)
      (IF (LISTP L)
	  (IF (CALL PRED (CAR L) NIL)
	      (COUNTPS-LOOP (CDR L) PRED (ADD1 ANS))
	      (COUNTPS-LOOP (CDR L) PRED ANS))
	  ANS))
     Linear arithmetic and the lemma CDR-LESSP can be used to
establish that the measure (COUNT L) decreases according to the
well-founded relation LESSP in each recursive call.  Hence,
COUNTPS-LOOP is accepted under the definitional principle.  Observe
that:
      (OR (NUMBERP (COUNTPS-LOOP L PRED ANS))
	  (EQUAL (COUNTPS-LOOP L PRED ANS) ANS))
is a theorem.




[ 0.09399821 0.0490030926 ]

COUNTPS-LOOP 


(DEFN COUNTPS-
      (L PRED)
      (COUNTPS-LOOP L PRED 0.))
     From the definition we can conclude that:
      (NUMBERP (COUNTPS- L PRED))
is a theorem.




[ 0.0220011394 0.0149983724 ]

COUNTPS- 


(DEFN COUNTPS
      (L PRED)
      (IF (LISTP L)
	  (IF (CALL PRED (CAR L) NIL)
	      (ADD1 (COUNTPS (CDR L) PRED))
	      (COUNTPS (CDR L) PRED))
	  0.))
     Linear arithmetic and the lemma CDR-LESSP inform us that the
measure (COUNT L) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, COUNTPS is accepted under the
definitional principle.  Note that (NUMBERP (COUNTPS L PRED)) is a
theorem.




[ 0.0880004885 0.0379964192 ]

COUNTPS 


(PROVE-LEMMA COUNTPS-COUNTPS
	     (REWRITE)
	     (IMPLIES (NUMBERP N)
		      (EQUAL (COUNTPS-LOOP L PRED N)
			     (PLUS N (COUNTPS L PRED)))))

     Give the conjecture the name *1.


     We will try to prove it by induction.  Three inductions are
suggested by terms in the conjecture.  They merge into two likely
candidate inductions.  However, only one is unflawed.  We will induct
according to the following scheme:
      (AND (IMPLIES (AND (LISTP L)
			 (P (CDR L) PRED (ADD1 N)))
		    (P L PRED N))
	   (IMPLIES (NOT (LISTP L))
		    (P L PRED N))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT L) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  Note, however, the inductive
instances chosen for N.  The above induction scheme leads to the
following two new goals:

Case 2. (IMPLIES (AND (LISTP L)
		      (EQUAL (COUNTPS-LOOP (CDR L) PRED (ADD1 N))
			     (PLUS (ADD1 N)
				   (COUNTPS (CDR L) PRED)))
		      (NUMBERP N))
		 (EQUAL (COUNTPS-LOOP L PRED N)
			(PLUS N (COUNTPS L PRED)))),

  which simplifies, rewriting with SUB1-ADD1 and PLUS-ADD1, and
  expanding the functions PLUS, COUNTPS-LOOP, and COUNTPS, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP L)) (NUMBERP N))
		 (EQUAL (COUNTPS-LOOP L PRED N)
			(PLUS N (COUNTPS L PRED)))),

  which we simplify, applying COMMUTATIVITY-OF-PLUS, and opening up
  COUNTPS-LOOP, COUNTPS, EQUAL, and PLUS, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.36900228 0.188997395 ]

COUNTPS-COUNTPS 


(DEFN FACT
      (I)
      (IF (ZEROP I)
	  1.
	  (TIMES I (FACT (SUB1 I)))))
     Linear arithmetic, the lemma COUNT-NUMBERP, and the definition
of ZEROP establish that the measure (COUNT I) decreases according to
the well-founded relation LESSP in each recursive call.  Hence, FACT
is accepted under the principle of definition.  Observe that
(NUMBERP (FACT I)) is a theorem.




[ 0.17499593 0.0440022787 ]

FACT 


(DEFN FACT-LOOP
      (I ANS)
      (IF (ZEROP I)
	  ANS
	  (FACT-LOOP (SUB1 I) (TIMES I ANS))))
     Linear arithmetic, the lemma COUNT-NUMBERP, and the definition
of ZEROP establish that the measure (COUNT I) decreases according to
the well-founded relation LESSP in each recursive call.  Hence,
FACT-LOOP is accepted under the principle of definition.  Note that:
      (OR (NUMBERP (FACT-LOOP I ANS))
	  (EQUAL (FACT-LOOP I ANS) ANS))
is a theorem.




[ 0.18100179 0.0490030926 ]

FACT-LOOP 


(DEFN FACT- (I) (FACT-LOOP I 1.))
     Observe that (NUMBERP (FACT- I)) is a theorem.




[ 0.0259969076 0.0100016276 ]

FACT- 


(PROVE-LEMMA FACT-LOOP-FACT
	     (REWRITE)
	     (IMPLIES (NUMBERP I)
		      (EQUAL (FACT-LOOP J I)
			     (TIMES I (FACT J)))))

     Call the conjecture *1.


     Perhaps we can prove it by induction.  There are three plausible
inductions.  They merge into two likely candidate inductions.
However, only one is unflawed.  We will induct according to the
following scheme:
      (AND (IMPLIES (ZEROP J) (P J I))
	   (IMPLIES (AND (NOT (ZEROP J))
			 (P (SUB1 J) (TIMES J I)))
		    (P J I))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP establish that the measure (COUNT J) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
Note, however, the inductive instance chosen for I.  The above
induction scheme generates the following two new formulas:

Case 2. (IMPLIES (AND (ZEROP J) (NUMBERP I))
		 (EQUAL (FACT-LOOP J I)
			(TIMES I (FACT J)))).

  This simplifies, applying COMMUTATIVITY-OF-TIMES, and unfolding
  ZEROP, EQUAL, FACT-LOOP, and FACT, to two new goals:

  Case 2.2.
          (IMPLIES (AND (EQUAL J 0) (NUMBERP I))
		   (EQUAL I (TIMES 1 I))),

    which we again simplify, using linear arithmetic, to:

          T.

  Case 2.1.
          (IMPLIES (AND (NOT (NUMBERP J)) (NUMBERP I))
		   (EQUAL I (TIMES 1 I))),

    which we again simplify, using linear arithmetic, to:

          T.

Case 1. (IMPLIES (AND (NOT (ZEROP J))
		      (EQUAL (FACT-LOOP (SUB1 J) (TIMES J I))
			     (TIMES (TIMES J I) (FACT (SUB1 J))))
		      (NUMBERP I))
		 (EQUAL (FACT-LOOP J I)
			(TIMES I (FACT J)))).

  This simplifies, rewriting with the lemmas COMMUTATIVITY-OF-TIMES,
  DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, and ASSOCIATIVITY-OF-TIMES, and
  unfolding the functions ZEROP, TIMES, FACT-LOOP, and FACT, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 2.30300292 0.232999675 ]

FACT-LOOP-FACT 


(PROVE-LEMMA FACT-FACT NIL
	     (EQUAL (FACT- I) (FACT I)))
This conjecture can be simplified, using the abbreviation FACT-, to:

      (EQUAL (FACT-LOOP I 1) (FACT I)),

which simplifies, rewriting with FACT-LOOP-FACT, to the new
conjecture:

      (EQUAL (TIMES 1 (FACT I)) (FACT I)).

However this simplifies again, using linear arithmetic, to:

      T.

Q.E.D.


[ 0.236999512 0.047998047 ]

FACT-FACT 


(DEFN REVERSE-LOOP
      (X ANS)
      (IF (LISTP X)
	  (REVERSE-LOOP (CDR X)
			(CONS (CAR X) ANS))
	  ANS))
     Linear arithmetic and the lemma CDR-LESSP inform us that the
measure (COUNT X) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, REVERSE-LOOP is accepted under
the principle of definition.  Observe that:
      (OR (LISTP (REVERSE-LOOP X ANS))
	  (EQUAL (REVERSE-LOOP X ANS) ANS))
is a theorem.




[ 0.082006836 0.0459960937 ]

REVERSE-LOOP 


(DEFN REVERSE-
      (X)
      (REVERSE-LOOP X NIL))
     Observe that (OR (LITATOM (REVERSE- X)) (LISTP (REVERSE- X))) is
a theorem.




[ 0.026997884 0.0120035807 ]

REVERSE- 


(PROVE-LEMMA REVERSE-LOOP-APPEND-REVERSE
	     (REWRITE)
	     (EQUAL (REVERSE-LOOP X Y)
		    (APPEND (REVERSE X) Y)))

     Call the conjecture *1.


     Perhaps we can prove it by induction.  There are two plausible
inductions.  However, they merge into one likely candidate induction.
We will induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP X)
			 (P (CDR X) (CONS (CAR X) Y)))
		    (P X Y))
	   (IMPLIES (NOT (LISTP X)) (P X Y))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  Note, however, the inductive
instance chosen for Y.  The above induction scheme produces two new
formulas:

Case 2. (IMPLIES (AND (LISTP X)
		      (EQUAL (REVERSE-LOOP (CDR X)
					   (CONS (CAR X) Y))
			     (APPEND (REVERSE (CDR X))
				     (CONS (CAR X) Y))))
		 (EQUAL (REVERSE-LOOP X Y)
			(APPEND (REVERSE X) Y))).

  This simplifies, applying CDR-CONS, CAR-CONS, and
  ASSOCIATIVITY-OF-APPEND, and expanding REVERSE-LOOP, REVERSE,
  APPEND, and LISTP, to:

        T.

Case 1. (IMPLIES (NOT (LISTP X))
		 (EQUAL (REVERSE-LOOP X Y)
			(APPEND (REVERSE X) Y))).

  This simplifies, expanding REVERSE-LOOP, REVERSE, LISTP, and APPEND,
  to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.246000163 0.16899821 ]

REVERSE-LOOP-APPEND-REVERSE 


(PROVE-LEMMA REVERSE-LOOP-REVERSE
	     (REWRITE)
	     (EQUAL (REVERSE-LOOP X NIL)
		    (REVERSE X)))
This formula can be simplified, using the abbreviation
REVERSE-LOOP-APPEND-REVERSE, to:

      (EQUAL (APPEND (REVERSE X) NIL)
	     (REVERSE X)).

This simplifies, appealing to the lemmas PLISTP-REVERSE and
APPEND-RIGHT-ID, to:

      T.

Q.E.D.


[ 0.080004883 0.033996582 ]

REVERSE-LOOP-REVERSE 


(PROVE-LEMMA REVERSE-APPEND NIL
	     (EQUAL (REVERSE- (APPEND A B))
		    (APPEND (REVERSE- B) (REVERSE- A))))
This conjecture can be simplified, using the abbreviations
APPEND-REVERSE, REVERSE-LOOP-REVERSE, and REVERSE-, to:

      (EQUAL (APPEND (REVERSE B) (REVERSE A))
	     (APPEND (REVERSE B) (REVERSE A))).

Of course, this simplifies, clearly, to:

      T.

Q.E.D.


[ 0.0409993487 0.0369995115 ]

REVERSE-APPEND 


(PROVE-LEMMA REVERSE-REVERSE- NIL
	     (IMPLIES (PLISTP X)
		      (EQUAL (REVERSE- (REVERSE- X)) X)))
This conjecture can be simplified, using the abbreviations IMPLIES,
REVERSE-LOOP-REVERSE, and REVERSE-, to the goal:

      (IMPLIES (PLISTP X)
	       (EQUAL (REVERSE (REVERSE X)) X)),

which simplifies, applying the lemma REVERSE-REVERSE, to:

      T.

Q.E.D.


[ 0.067004395 0.038000488 ]

REVERSE-REVERSE- 


(DEFN SORT-LP
      (X Y)
      (IF (LISTP X)
	  (SORT-LP (CDR X)
		   (ADDTOLIST (CAR X) Y))
	  Y))
     Linear arithmetic and the lemma CDR-LESSP inform us that the
measure (COUNT X) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, SORT-LP is accepted under the
principle of definition.  Observe that:
      (OR (LISTP (SORT-LP X Y))
	  (EQUAL (SORT-LP X Y) Y))
is a theorem.




[ 0.080997721 0.0460042316 ]

SORT-LP 


(PROVE-LEMMA ORDERED-ADDTOLIST
	     (REWRITE)
	     (IMPLIES (ORDERED Y)
		      (ORDERED (ADDTOLIST X Y))))

     Name the conjecture *1.


     We will try to prove it by induction.  There are two plausible
inductions.  However, they merge into one likely candidate induction.
We will induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP Y)
			 (LISTP (CDR Y))
			 (LESSP (CADR Y) (CAR Y)))
		    (P X Y))
	   (IMPLIES (AND (LISTP Y)
			 (LISTP (CDR Y))
			 ( LEQ (CAR Y) (CADR Y))
			 (P X (CDR Y)))
		    (P X Y))
	   (IMPLIES (AND (LISTP Y) (NOT (LISTP (CDR Y))))
		    (P X Y))
	   (IMPLIES (NOT (LISTP Y)) (P X Y))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
generates the following five new formulas:

Case 5. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      (LESSP (CADR Y) (CAR Y))
		      (ORDERED Y))
		 (ORDERED (ADDTOLIST X Y))),

  which simplifies, expanding the definition of ORDERED, to:

        T.

Case 4. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CAR Y) (CADR Y))
		      (NOT (ORDERED (CDR Y)))
		      (ORDERED Y))
		 (ORDERED (ADDTOLIST X Y))),

  which we simplify, unfolding ORDERED, to:

        T.

Case 3. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CAR Y) (CADR Y))
		      (ORDERED (ADDTOLIST X (CDR Y)))
		      (ORDERED Y))
		 (ORDERED (ADDTOLIST X Y))),

  which simplifies, unfolding the functions ORDERED and ADDTOLIST, to
  the following two new goals:

  Case 3.2.
          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CAR Y) (CADR Y))
			(ORDERED (ADDTOLIST X (CDR Y)))
			(ORDERED (CDR Y))
			( LEQ (CAR Y) X))
		   (ORDERED (CONS (CAR Y)
				  (ADDTOLIST X (CDR Y))))),

    which again simplifies, rewriting with CAR-CONS and CDR-CONS, and
    expanding ORDERED, to the new conjecture:

          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CAR Y) (CADR Y))
			(ORDERED (ADDTOLIST X (CDR Y)))
			(ORDERED (CDR Y))
			( LEQ (CAR Y) X))
		   ( LEQ
		     (CAR Y)
		     (CAR (ADDTOLIST X (CDR Y))))).

    Appealing to the lemma CAR-CDR-ELIM, we now replace Y by
    (CONS V Z) to eliminate (CDR Y) and (CAR Y) and Z by (CONS W D)
    to eliminate (CAR Z) and (CDR Z).  We would thus like to prove
    the new formula:

          (IMPLIES (AND ( LEQ V W)
			(ORDERED (ADDTOLIST X (CONS W D)))
			(ORDERED (CONS W D))
			( LEQ V X))
		   ( LEQ V
		     (CAR (ADDTOLIST X (CONS W D))))).

    This further simplifies, rewriting with CDR-CONS and CAR-CONS,
    and expanding the definitions of ADDTOLIST and ORDERED, to:

          T.

  Case 3.1.
          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CAR Y) (CADR Y))
			(ORDERED (ADDTOLIST X (CDR Y)))
			(ORDERED (CDR Y))
			(LESSP X (CAR Y)))
		   (ORDERED (CONS X Y))).

    However this again simplifies, rewriting with the lemmas CAR-CONS
    and CDR-CONS, and unfolding the definition of ORDERED, to the
    formula:

          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CAR Y) (CADR Y))
			(ORDERED (ADDTOLIST X (CDR Y)))
			(ORDERED (CDR Y))
			(LESSP X (CAR Y)))
		   ( LEQ X (CAR Y))),

    which we again simplify, using linear arithmetic, to:

          T.

Case 2. (IMPLIES (AND (LISTP Y)
		      (NOT (LISTP (CDR Y)))
		      (ORDERED Y))
		 (ORDERED (ADDTOLIST X Y))).

  This simplifies, expanding the functions ORDERED and ADDTOLIST, to
  two new conjectures:

  Case 2.2.
          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			( LEQ (CAR Y) X))
		   (ORDERED (CONS (CAR Y)
				  (ADDTOLIST X (CDR Y))))),

    which again simplifies, applying CAR-CONS and CDR-CONS, and
    opening up the function ORDERED, to the following two new
    conjectures:

    Case 2.2.2.
            (IMPLIES (AND (LISTP Y)
			  (NOT (LISTP (CDR Y)))
			  ( LEQ (CAR Y) X))
		     ( LEQ
		       (CAR Y)
		       (CAR (ADDTOLIST X (CDR Y))))),

      which further simplifies, applying CAR-CONS, and opening up the
      definition of ADDTOLIST, to:

            T.

    Case 2.2.1.
            (IMPLIES (AND (LISTP Y)
			  (NOT (LISTP (CDR Y)))
			  ( LEQ (CAR Y) X))
		     (ORDERED (ADDTOLIST X (CDR Y)))),

      which we further simplify, applying CDR-CONS, and opening up
      the functions ADDTOLIST, LISTP, and ORDERED, to:

            T.

  Case 2.1.
          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(LESSP X (CAR Y)))
		   (ORDERED (CONS X Y))),

    which we again simplify, applying CAR-CONS and CDR-CONS, and
    expanding ORDERED, to the formula:

          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(LESSP X (CAR Y)))
		   ( LEQ X (CAR Y))).

    This simplifies again, using linear arithmetic, to:

          T.

Case 1. (IMPLIES (AND (NOT (LISTP Y)) (ORDERED Y))
		 (ORDERED (ADDTOLIST X Y))).

  This simplifies, rewriting with CDR-CONS, and expanding the
  definitions of ORDERED, ADDTOLIST, and LISTP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 6.89500326 0.632995605 ]

ORDERED-ADDTOLIST 


(PROVE-LEMMA ORDERED-SORT-LP
	     (REWRITE)
	     (IMPLIES (ORDERED Y)
		      (ORDERED (SORT-LP X Y))))

     Name the conjecture *1.


     We will try to prove it by induction.  There are two plausible
inductions.  However, only one is unflawed.  We will induct according
to the following scheme:
      (AND (IMPLIES (AND (LISTP X)
			 (P (CDR X) (ADDTOLIST (CAR X) Y)))
		    (P X Y))
	   (IMPLIES (NOT (LISTP X)) (P X Y))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  Note, however, the inductive
instance chosen for Y.  The above induction scheme generates the
following three new formulas:

Case 3. (IMPLIES (AND (LISTP X)
		      (NOT (ORDERED (ADDTOLIST (CAR X) Y)))
		      (ORDERED Y))
		 (ORDERED (SORT-LP X Y))),

  which simplifies, applying ORDERED-ADDTOLIST, to:

        T.

Case 2. (IMPLIES (AND (LISTP X)
		      (ORDERED (SORT-LP (CDR X)
					(ADDTOLIST (CAR X) Y)))
		      (ORDERED Y))
		 (ORDERED (SORT-LP X Y))),

  which we simplify, opening up SORT-LP, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP X)) (ORDERED Y))
		 (ORDERED (SORT-LP X Y))),

  which we simplify, unfolding SORT-LP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.8930013 0.171000162 ]

ORDERED-SORT-LP 


(PROVE-LEMMA COUNT-SORT-LP
	     (REWRITE)
	     (EQUAL (COUNT-LIST Z (SORT-LP X Y))
		    (PLUS (COUNT-LIST Z X)
			  (COUNT-LIST Z Y))))

     Give the conjecture the name *1.


     We will try to prove it by induction.  Three inductions are
suggested by terms in the conjecture.  They merge into two likely
candidate inductions.  However, only one is unflawed.  We will induct
according to the following scheme:
      (AND (IMPLIES (AND (LISTP X)
			 (P Z (CDR X) (ADDTOLIST (CAR X) Y)))
		    (P Z X Y))
	   (IMPLIES (NOT (LISTP X)) (P Z X Y))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  Note, however, the inductive
instance chosen for Y.  The above induction scheme leads to the
following two new goals:

Case 2. (IMPLIES
	      (AND (LISTP X)
		   (EQUAL (COUNT-LIST Z
				      (SORT-LP (CDR X)
					       (ADDTOLIST (CAR X) Y)))
			  (PLUS (COUNT-LIST Z (CDR X))
				(COUNT-LIST Z
					    (ADDTOLIST (CAR X) Y)))))
	      (EQUAL (COUNT-LIST Z (SORT-LP X Y))
		     (PLUS (COUNT-LIST Z X)
			   (COUNT-LIST Z Y)))),

  which simplifies, rewriting with COMMUTATIVITY-OF-PLUS, and
  expanding the functions SORT-LP and COUNT-LIST, to two new
  conjectures:

  Case 2.2.
          (IMPLIES
	      (AND (LISTP X)
		   (EQUAL (COUNT-LIST Z
				      (SORT-LP (CDR X)
					       (ADDTOLIST (CAR X) Y)))
			  (PLUS (COUNT-LIST Z (CDR X))
				(COUNT-LIST Z (ADDTOLIST (CAR X) Y))))
		   (NOT (EQUAL Z (CAR X))))
	      (EQUAL (COUNT-LIST Z
				 (SORT-LP (CDR X)
					  (ADDTOLIST (CAR X) Y)))
		     (PLUS (COUNT-LIST Z Y)
			   (COUNT-LIST Z (CDR X))))).

    Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS W V)
    to eliminate (CDR X) and (CAR X).  We must thus prove:

          (IMPLIES
		  (AND (EQUAL (COUNT-LIST Z
					  (SORT-LP V (ADDTOLIST W Y)))
			      (PLUS (COUNT-LIST Z V)
				    (COUNT-LIST Z (ADDTOLIST W Y))))
		       (NOT (EQUAL Z W)))
		  (EQUAL (COUNT-LIST Z
				     (SORT-LP V (ADDTOLIST W Y)))
			 (PLUS (COUNT-LIST Z Y)
			       (COUNT-LIST Z V)))),

    which further simplifies, rewriting with COMMUTATIVITY-OF-PLUS,
    to the goal:

          (IMPLIES
		  (AND (EQUAL (COUNT-LIST Z
					  (SORT-LP V (ADDTOLIST W Y)))
			      (PLUS (COUNT-LIST Z V)
				    (COUNT-LIST Z (ADDTOLIST W Y))))
		       (NOT (EQUAL Z W)))
		  (EQUAL (COUNT-LIST Z
				     (SORT-LP V (ADDTOLIST W Y)))
			 (PLUS (COUNT-LIST Z V)
			       (COUNT-LIST Z Y)))).

    We now use the above equality hypothesis by substituting:
          (PLUS (COUNT-LIST Z V)
		(COUNT-LIST Z (ADDTOLIST W Y)))
    for (COUNT-LIST Z (SORT-LP V (ADDTOLIST W Y))) and throwing away
    the equality.  The result is:

          (IMPLIES (NOT (EQUAL Z W))
		   (EQUAL (PLUS (COUNT-LIST Z V)
				(COUNT-LIST Z (ADDTOLIST W Y)))
			  (PLUS (COUNT-LIST Z V)
				(COUNT-LIST Z Y)))),

    which we further simplify, rewriting with the lemma
    CORRECTNESS-OF-CANCEL, and expanding the definition of FIX, to:

          (IMPLIES (NOT (EQUAL Z W))
		   (EQUAL (COUNT-LIST Z (ADDTOLIST W Y))
			  (COUNT-LIST Z Y))),

    which we will finally name *1.1.

  Case 2.1.
          (IMPLIES
	      (AND (LISTP X)
		   (EQUAL (COUNT-LIST Z
				      (SORT-LP (CDR X)
					       (ADDTOLIST (CAR X) Y)))
			  (PLUS (COUNT-LIST Z (CDR X))
				(COUNT-LIST Z (ADDTOLIST (CAR X) Y))))
		   (EQUAL Z (CAR X)))
	      (EQUAL (COUNT-LIST Z
				 (SORT-LP (CDR X)
					  (ADDTOLIST (CAR X) Y)))
		     (PLUS (COUNT-LIST Z Y)
			   (ADD1 (COUNT-LIST Z (CDR X)))))),

    which we again simplify, rewriting with PLUS-ADD1, to:

          (IMPLIES
	      (AND (LISTP X)
		   (EQUAL (COUNT-LIST (CAR X)
				      (SORT-LP (CDR X)
					       (ADDTOLIST (CAR X) Y)))
			  (PLUS (COUNT-LIST (CAR X) (CDR X))
				(COUNT-LIST (CAR X)
					    (ADDTOLIST (CAR X) Y)))))
	      (EQUAL (COUNT-LIST (CAR X)
				 (SORT-LP (CDR X)
					  (ADDTOLIST (CAR X) Y)))
		     (ADD1 (PLUS (COUNT-LIST (CAR X) Y)
				 (COUNT-LIST (CAR X) (CDR X)))))).

    Applying the lemma CAR-CDR-ELIM, replace X by (CONS V W) to
    eliminate (CAR X) and (CDR X).  This produces:

          (IMPLIES (EQUAL (COUNT-LIST V
				      (SORT-LP W (ADDTOLIST V Y)))
			  (PLUS (COUNT-LIST V W)
				(COUNT-LIST V (ADDTOLIST V Y))))
		   (EQUAL (COUNT-LIST V
				      (SORT-LP W (ADDTOLIST V Y)))
			  (ADD1 (PLUS (COUNT-LIST V Y)
				      (COUNT-LIST V W))))).

    But this simplifies further, applying COMMUTATIVITY-OF-PLUS, to
    the new formula:

          (IMPLIES (EQUAL (COUNT-LIST V
				      (SORT-LP W (ADDTOLIST V Y)))
			  (PLUS (COUNT-LIST V W)
				(COUNT-LIST V (ADDTOLIST V Y))))
		   (EQUAL (COUNT-LIST V
				      (SORT-LP W (ADDTOLIST V Y)))
			  (ADD1 (PLUS (COUNT-LIST V W)
				      (COUNT-LIST V Y))))).

    We use the above equality hypothesis by substituting:
          (PLUS (COUNT-LIST V W)
		(COUNT-LIST V (ADDTOLIST V Y)))
    for (COUNT-LIST V (SORT-LP W (ADDTOLIST V Y))) and throwing away
    the equality.  We thus obtain:

          (EQUAL (PLUS (COUNT-LIST V W)
		       (COUNT-LIST V (ADDTOLIST V Y)))
		 (ADD1 (PLUS (COUNT-LIST V W)
			     (COUNT-LIST V Y)))),

    which we generalize by replacing (COUNT-LIST V W) by A.  We
    restrict the new variable by appealing to the type restriction
    lemma noted when COUNT-LIST was introduced.  We thus obtain:

          (IMPLIES (NUMBERP A)
		   (EQUAL (PLUS A
				(COUNT-LIST V (ADDTOLIST V Y)))
			  (ADD1 (PLUS A (COUNT-LIST V Y))))),

    which we will finally name *1.2.

Case 1. (IMPLIES (NOT (LISTP X))
		 (EQUAL (COUNT-LIST Z (SORT-LP X Y))
			(PLUS (COUNT-LIST Z X)
			      (COUNT-LIST Z Y)))),

  which simplifies, unfolding the definitions of SORT-LP, COUNT-LIST,
  EQUAL, and PLUS, to:

        T.


     So let us turn our attention to:

      (IMPLIES (NUMBERP A)
	       (EQUAL (PLUS A
			    (COUNT-LIST V (ADDTOLIST V Y)))
		      (ADD1 (PLUS A (COUNT-LIST V Y))))),

named *1.2 above.  We will try to prove it by induction.  There are
four plausible inductions.  They merge into two likely candidate
inductions, both of which are unflawed.  However, one of these is
more likely than the other.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (LISTP Y) (LESSP V (CAR Y)))
		    (P A V Y))
	   (IMPLIES (AND (LISTP Y)
			 ( LEQ (CAR Y) V)
			 (P A V (CDR Y)))
		    (P A V Y))
	   (IMPLIES (NOT (LISTP Y)) (P A V Y))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme leads
to three new goals:

Case 3. (IMPLIES (AND (LISTP Y)
		      (LESSP V (CAR Y))
		      (NUMBERP A))
		 (EQUAL (PLUS A
			      (COUNT-LIST V (ADDTOLIST V Y)))
			(ADD1 (PLUS A (COUNT-LIST V Y))))).

  This simplifies, opening up the definitions of ADDTOLIST and
  COUNT-LIST, to two new goals:

  Case 3.2.
          (IMPLIES (AND (LISTP Y)
			(LESSP V (CAR Y))
			(NUMBERP A)
			(NOT (EQUAL V (CAR Y))))
		   (EQUAL (PLUS A (COUNT-LIST V (CONS V Y)))
			  (ADD1 (PLUS A (COUNT-LIST V (CDR Y)))))),

    which we again simplify, applying the lemmas CDR-CONS, CAR-CONS,
    and PLUS-ADD1, and opening up the definition of COUNT-LIST, to:

          T.

  Case 3.1.
          (IMPLIES
		 (AND (LISTP Y)
		      (LESSP V (CAR Y))
		      (NUMBERP A)
		      (EQUAL V (CAR Y)))
		 (EQUAL (PLUS A (COUNT-LIST V (CONS V Y)))
			(ADD1 (PLUS A
				    (ADD1 (COUNT-LIST V (CDR Y))))))),

    which we again simplify, using linear arithmetic, to:

          T.

Case 2. (IMPLIES
	       (AND (LISTP Y)
		    ( LEQ (CAR Y) V)
		    (EQUAL (PLUS A
				 (COUNT-LIST V (ADDTOLIST V (CDR Y))))
			   (ADD1 (PLUS A (COUNT-LIST V (CDR Y)))))
		    (NUMBERP A))
	       (EQUAL (PLUS A
			    (COUNT-LIST V (ADDTOLIST V Y)))
		      (ADD1 (PLUS A (COUNT-LIST V Y))))),

  which simplifies, rewriting with CDR-CONS and CAR-CONS, and opening
  up the definitions of ADDTOLIST and COUNT-LIST, to the goal:

        (IMPLIES
	     (AND (LISTP Y)
		  ( LEQ (CAR Y) V)
		  (EQUAL (PLUS A
			       (COUNT-LIST V (ADDTOLIST V (CDR Y))))
			 (ADD1 (PLUS A (COUNT-LIST V (CDR Y)))))
		  (NUMBERP A)
		  (EQUAL V (CAR Y)))
	     (EQUAL (PLUS A
			  (ADD1 (COUNT-LIST V (ADDTOLIST V (CDR Y)))))
		    (ADD1 (PLUS A
				(ADD1 (COUNT-LIST V (CDR Y))))))),

  which again simplifies, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP Y)) (NUMBERP A))
		 (EQUAL (PLUS A
			      (COUNT-LIST V (ADDTOLIST V Y)))
			(ADD1 (PLUS A (COUNT-LIST V Y))))).

  This simplifies, applying CDR-CONS, CAR-CONS, and
  COMMUTATIVITY-OF-PLUS, and expanding the functions ADDTOLIST,
  COUNT-LIST, LISTP, ADD1, EQUAL, and PLUS, to:

        (IMPLIES (AND (NOT (LISTP Y)) (NUMBERP A))
		 (EQUAL (PLUS 1 A) (ADD1 A))),

  which again simplifies, using linear arithmetic, to:

        T.


     That finishes the proof of *1.2.


     So let us turn our attention to:

      (IMPLIES (NOT (EQUAL Z W))
	       (EQUAL (COUNT-LIST Z (ADDTOLIST W Y))
		      (COUNT-LIST Z Y))),

which we named *1.1 above.  Let us appeal to the induction principle.
Two inductions are suggested by terms in the conjecture.  However,
they merge into one likely candidate induction.  We will induct
according to the following scheme:
      (AND (IMPLIES (AND (LISTP Y) (LESSP W (CAR Y)))
		    (P Z W Y))
	   (IMPLIES (AND (LISTP Y)
			 ( LEQ (CAR Y) W)
			 (P Z W (CDR Y)))
		    (P Z W Y))
	   (IMPLIES (NOT (LISTP Y)) (P Z W Y))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
produces three new goals:

Case 3. (IMPLIES (AND (LISTP Y)
		      (LESSP W (CAR Y))
		      (NOT (EQUAL Z W)))
		 (EQUAL (COUNT-LIST Z (ADDTOLIST W Y))
			(COUNT-LIST Z Y))),

  which simplifies, expanding ADDTOLIST and COUNT-LIST, to the
  following two new conjectures:

  Case 3.2.
          (IMPLIES (AND (LISTP Y)
			(LESSP W (CAR Y))
			(NOT (EQUAL Z W))
			(NOT (EQUAL Z (CAR Y))))
		   (EQUAL (COUNT-LIST Z (CONS W Y))
			  (COUNT-LIST Z (CDR Y)))),

    which again simplifies, rewriting with CDR-CONS and CAR-CONS, and
    expanding the function COUNT-LIST, to:

          T.

  Case 3.1.
          (IMPLIES (AND (LISTP Y)
			(LESSP W (CAR Y))
			(NOT (EQUAL Z W))
			(EQUAL Z (CAR Y)))
		   (EQUAL (COUNT-LIST Z (CONS W Y))
			  (ADD1 (COUNT-LIST Z (CDR Y))))).

    However this simplifies again, rewriting with the lemmas CDR-CONS
    and CAR-CONS, and unfolding the function COUNT-LIST, to the
    formula:

          (IMPLIES (AND (LISTP Y)
			(LESSP W (CAR Y))
			(NOT (EQUAL (CAR Y) W)))
		   (EQUAL (COUNT-LIST (CAR Y) Y)
			  (ADD1 (COUNT-LIST (CAR Y) (CDR Y))))).

    However this again simplifies, opening up the definition of
    COUNT-LIST, to:

          T.

Case 2. (IMPLIES (AND (LISTP Y)
		      ( LEQ (CAR Y) W)
		      (EQUAL (COUNT-LIST Z (ADDTOLIST W (CDR Y)))
			     (COUNT-LIST Z (CDR Y)))
		      (NOT (EQUAL Z W)))
		 (EQUAL (COUNT-LIST Z (ADDTOLIST W Y))
			(COUNT-LIST Z Y))).

  This simplifies, applying CDR-CONS and CAR-CONS, and opening up the
  functions ADDTOLIST and COUNT-LIST, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP Y))
		      (NOT (EQUAL Z W)))
		 (EQUAL (COUNT-LIST Z (ADDTOLIST W Y))
			(COUNT-LIST Z Y))).

  This simplifies, applying CDR-CONS and CAR-CONS, and expanding
  ADDTOLIST, COUNT-LIST, LISTP, and EQUAL, to:

        T.


     That finishes the proof of *1.1, which finishes the proof of *1.
Q.E.D.


[ 20.7409995 1.32100016 ]

COUNT-SORT-LP 


(PROVE-LEMMA APPEND-CANCELLATION
	     (REWRITE)
	     (EQUAL (EQUAL (APPEND A B) (APPEND A C))
		    (EQUAL B C)))
This formula simplifies, obviously, to the following two new goals:

Case 2. (IMPLIES (NOT (EQUAL B C))
		 (NOT (EQUAL (APPEND A B) (APPEND A C)))),

  which we will name *1.

Case 1. (IMPLIES (EQUAL B C)
		 (EQUAL (EQUAL (APPEND A B) (APPEND A C))
			T)),

  which again simplifies, unfolding the function EQUAL, to:

        T.


     So next consider:

      (IMPLIES (NOT (EQUAL B C))
	       (NOT (EQUAL (APPEND A B) (APPEND A C)))),

which we named *1 above.  We will appeal to induction.  The recursive
terms in the conjecture suggest two inductions.  However, they merge
into one likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (LISTP A) (P (CDR A) B C))
		    (P A B C))
	   (IMPLIES (NOT (LISTP A)) (P A B C))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT A) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
produces two new conjectures:

Case 2. (IMPLIES (AND (LISTP A)
		      (NOT (EQUAL (APPEND (CDR A) B)
				  (APPEND (CDR A) C)))
		      (NOT (EQUAL B C)))
		 (NOT (EQUAL (APPEND A B) (APPEND A C)))),

  which we simplify, rewriting with CAR-CONS and CDR-CONS, and
  unfolding the function APPEND, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP A))
		      (NOT (EQUAL B C)))
		 (NOT (EQUAL (APPEND A B) (APPEND A C)))).

  This simplifies, opening up the function APPEND, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.348002117 0.210998535 ]

APPEND-CANCELLATION 


(PROVE-LEMMA EQUAL-LESSP
	     (REWRITE)
	     (EQUAL (EQUAL (LESSP X Y) Z)
		    (IF (LESSP X Y)
			(EQUAL T Z)
			(EQUAL F Z))))
This simplifies, trivially, to four new conjectures:

Case 4. (IMPLIES (AND (EQUAL (LESSP X Y) Z) ( LEQ Y X))
		 (NOT Z)).

  This again simplifies, trivially, to:

        T.

Case 3. (IMPLIES (AND (NOT (EQUAL (LESSP X Y) Z))
		      ( LEQ Y X))
		 Z),

  which we again simplify, clearly, to:

        T.

Case 2. (IMPLIES (AND (NOT (EQUAL (LESSP X Y) Z))
		      (LESSP X Y))
		 (NOT (EQUAL T Z))),

  which again simplifies, trivially, to:

        T.

Case 1. (IMPLIES (AND (EQUAL (LESSP X Y) Z)
		      (LESSP X Y))
		 (EQUAL (EQUAL T Z) T)),

  which again simplifies, obviously, to:

        T.

Q.E.D.


[ 0.213993328 0.08700358 ]

EQUAL-LESSP 


(PROVE-LEMMA DIFFERENCE-ELIM
	     (ELIM)
	     (IMPLIES (AND (NUMBERP Y) ( LEQ X Y))
		      (EQUAL (PLUS X (DIFFERENCE Y X)) Y)))
This simplifies, using linear arithmetic, to:

      T.

Q.E.D.


[ 0.1050008135 0.0140014648 ]

DIFFERENCE-ELIM 


(DEFN POWER-EVAL
      (L BASE)
      (IF (LISTP L)
	  (PLUS (CAR L)
		(TIMES BASE
		       (POWER-EVAL (CDR L) BASE)))
	  0.))
     Linear arithmetic and the lemma CDR-LESSP inform us that the
measure (COUNT L) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, POWER-EVAL is accepted under
the principle of definition.  From the definition we can conclude
that (NUMBERP (POWER-EVAL L BASE)) is a theorem.




[ 0.11899821 0.043001302 ]

POWER-EVAL 


(DEFN BIG-PLUS1
      (L I BASE)
      (IF (LISTP L)
	  (IF (ZEROP I)
	      L
	      (CONS (REMAINDER (PLUS (CAR L) I) BASE)
		    (BIG-PLUS1 (CDR L)
			       (QUOTIENT (PLUS (CAR L) I) BASE)
			       BASE)))
	  (CONS I NIL)))
     Linear arithmetic and the lemma CDR-LESSP inform us that the
measure (COUNT L) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, BIG-PLUS1 is accepted under the
principle of definition.  From the definition we can conclude that:
      (LISTP (BIG-PLUS1 L I BASE))
is a theorem.




[ 1.43699951 0.0439982098 ]

BIG-PLUS1 


(PROVE-LEMMA REMAINDER-QUOTIENT
	     (REWRITE)
	     (EQUAL (PLUS (REMAINDER X Y)
			  (TIMES Y (QUOTIENT X Y)))
		    (FIX X)))
This simplifies, opening up the definition of FIX, to two new
conjectures:

Case 2. (IMPLIES (NOT (NUMBERP X))
		 (EQUAL (PLUS (REMAINDER X Y)
			      (TIMES Y (QUOTIENT X Y)))
			0)),

  which again simplifies, applying the lemma COMMUTATIVITY-OF-TIMES,
  and unfolding LESSP, REMAINDER, QUOTIENT, EQUAL, TIMES, and PLUS,
  to:

        T.

Case 1. (IMPLIES (NUMBERP X)
		 (EQUAL (PLUS (REMAINDER X Y)
			      (TIMES Y (QUOTIENT X Y)))
			X)),

  which we will name *1.


     We will appeal to induction.  Three inductions are suggested by
terms in the conjecture.  They merge into two likely candidate
inductions.  However, only one is unflawed.  We will induct according
to the following scheme:
      (AND (IMPLIES (ZEROP Y) (P X Y))
	   (IMPLIES (AND (NOT (ZEROP Y)) (LESSP X Y))
		    (P X Y))
	   (IMPLIES (AND (NOT (ZEROP Y))
			 ( LEQ Y X)
			 (P (DIFFERENCE X Y) Y))
		    (P X Y))).
Linear arithmetic, the lemmas COUNT-NUMBERP and COUNT-NOT-LESSP, and
the definition of ZEROP establish that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each
induction step of the scheme.  The above induction scheme generates
three new formulas:

Case 3. (IMPLIES (AND (ZEROP Y) (NUMBERP X))
		 (EQUAL (PLUS (REMAINDER X Y)
			      (TIMES Y (QUOTIENT X Y)))
			X)),

  which we simplify, rewriting with COMMUTATIVITY-OF-PLUS,
  TIMES-ZERO2, and COMMUTATIVITY-OF-TIMES, and unfolding the
  functions ZEROP, EQUAL, REMAINDER, QUOTIENT, TIMES, and PLUS, to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP Y))
		      (LESSP X Y)
		      (NUMBERP X))
		 (EQUAL (PLUS (REMAINDER X Y)
			      (TIMES Y (QUOTIENT X Y)))
			X)).

  This simplifies, rewriting with COMMUTATIVITY-OF-TIMES and
  COMMUTATIVITY-OF-PLUS, and expanding ZEROP, REMAINDER, QUOTIENT,
  EQUAL, TIMES, and PLUS, to:

        T.

Case 1. (IMPLIES
	      (AND (NOT (ZEROP Y))
		   ( LEQ Y X)
		   (EQUAL (PLUS (REMAINDER (DIFFERENCE X Y) Y)
				(TIMES Y
				       (QUOTIENT (DIFFERENCE X Y) Y)))
			  (DIFFERENCE X Y))
		   (NUMBERP X))
	      (EQUAL (PLUS (REMAINDER X Y)
			   (TIMES Y (QUOTIENT X Y)))
		     X)),

  which we simplify, rewriting with the lemmas TIMES-ADD1 and
  COMMUTATIVITY2-OF-PLUS, and expanding the definitions of ZEROP,
  REMAINDER, and QUOTIENT, to:

        (IMPLIES
	      (AND (NOT (EQUAL Y 0))
		   (NUMBERP Y)
		   ( LEQ Y X)
		   (EQUAL (PLUS (REMAINDER (DIFFERENCE X Y) Y)
				(TIMES Y
				       (QUOTIENT (DIFFERENCE X Y) Y)))
			  (DIFFERENCE X Y))
		   (NUMBERP X))
	      (EQUAL (PLUS Y (DIFFERENCE X Y)) X)),

  which we again simplify, using linear arithmetic, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 3.60800782 0.336991373 ]

REMAINDER-QUOTIENT 


(PROVE-LEMMA POWER-EVAL-BIG-PLUS1
	     (REWRITE)
	     (EQUAL (POWER-EVAL (BIG-PLUS1 L I BASE) BASE)
		    (PLUS (POWER-EVAL L BASE) I)))
This simplifies, rewriting with COMMUTATIVITY-OF-PLUS, to the new
conjecture:

      (EQUAL (POWER-EVAL (BIG-PLUS1 L I BASE) BASE)
	     (PLUS I (POWER-EVAL L BASE))).

Call the above conjecture *1.


     We will appeal to induction.  There are three plausible
inductions.  They merge into two likely candidate inductions.
However, only one is unflawed.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (LISTP L) (ZEROP I))
		    (P L I BASE))
	   (IMPLIES (AND (LISTP L)
			 (NOT (ZEROP I))
			 (P (CDR L)
			    (QUOTIENT (PLUS (CAR L) I) BASE)
			    BASE))
		    (P L I BASE))
	   (IMPLIES (NOT (LISTP L))
		    (P L I BASE))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT L) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  Note, however, the inductive
instance chosen for I.  The above induction scheme leads to the
following three new conjectures:

Case 3. (IMPLIES (AND (LISTP L) (ZEROP I))
		 (EQUAL (POWER-EVAL (BIG-PLUS1 L I BASE) BASE)
			(PLUS I (POWER-EVAL L BASE)))).

  This simplifies, applying CORRECTNESS-OF-CANCEL, and expanding the
  functions ZEROP, EQUAL, BIG-PLUS1, POWER-EVAL, and FIX, to:

        T.

Case 2. (IMPLIES
	 (AND
	  (LISTP L)
	  (NOT (ZEROP I))
	  (EQUAL
	       (POWER-EVAL (BIG-PLUS1 (CDR L)
				      (QUOTIENT (PLUS (CAR L) I) BASE)
				      BASE)
			   BASE)
	       (PLUS (QUOTIENT (PLUS (CAR L) I) BASE)
		     (POWER-EVAL (CDR L) BASE))))
	 (EQUAL (POWER-EVAL (BIG-PLUS1 L I BASE) BASE)
		(PLUS I (POWER-EVAL L BASE)))).

  This simplifies, rewriting with the lemmas COMMUTATIVITY-OF-PLUS,
  DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, CDR-CONS, CAR-CONS,
  CORRECTNESS-OF-CANCEL, and REMAINDER-QUOTIENT, and unfolding the
  functions ZEROP, BIG-PLUS1, and POWER-EVAL, to:

        T.

Case 1. (IMPLIES (NOT (LISTP L))
		 (EQUAL (POWER-EVAL (BIG-PLUS1 L I BASE) BASE)
			(PLUS I (POWER-EVAL L BASE)))).

  This simplifies, rewriting with CDR-CONS, CAR-CONS,
  COMMUTATIVITY-OF-TIMES, and COMMUTATIVITY-OF-PLUS, and expanding
  BIG-PLUS1, POWER-EVAL, LISTP, EQUAL, TIMES, and PLUS, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 5.54000247 0.273994956 ]

POWER-EVAL-BIG-PLUS1 


(DEFN BIG-PLUS
     (X Y I BASE)
     (IF (LISTP X)
	 (IF (LISTP Y)
	     (CONS (REMAINDER (PLUS I (PLUS (CAR X) (CAR Y)))
			      BASE)
		   (BIG-PLUS (CDR X)
			     (CDR Y)
			     (QUOTIENT (PLUS I (PLUS (CAR X) (CAR Y)))
				       BASE)
			     BASE))
	     (BIG-PLUS1 X I BASE))
	 (BIG-PLUS1 Y I BASE)))
     Linear arithmetic and the lemma CDR-LESSP inform us that the
measure (COUNT X) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, BIG-PLUS is accepted under the
principle of definition.  The definition of BIG-PLUS can be justified
in another way.  Linear arithmetic and the lemma CDR-LESSP establish
that the measure (COUNT Y) decreases according to the well-founded
relation LESSP in each recursive call.  Note that:
      (LISTP (BIG-PLUS X Y I BASE))
is a theorem.




[ 0.194995116 0.071004231 ]

BIG-PLUS 


(PROVE-LEMMA POWER-EVAL-BIG-PLUS
	     (REWRITE)
	     (EQUAL (POWER-EVAL (BIG-PLUS X Y I BASE)
				BASE)
		    (PLUS I
			  (PLUS (POWER-EVAL X BASE)
				(POWER-EVAL Y BASE)))))

     Give the conjecture the name *1.


     We will try to prove it by induction.  Five inductions are
suggested by terms in the conjecture.  They merge into two likely
candidate inductions.  However, only one is unflawed.  We will induct
according to the following scheme:
      (AND (IMPLIES (AND (LISTP X)
			 (LISTP Y)
			 (P (CDR X)
			    (CDR Y)
			    (QUOTIENT (PLUS I (PLUS (CAR X) (CAR Y)))
				      BASE)
			    BASE))
		    (P X Y I BASE))
	   (IMPLIES (AND (LISTP X) (NOT (LISTP Y)))
		    (P X Y I BASE))
	   (IMPLIES (NOT (LISTP X))
		    (P X Y I BASE))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  Note, however, the inductive
instances chosen for Y and I.  The above induction scheme leads to
the following three new goals:

Case 3. (IMPLIES
	 (AND
	  (LISTP X)
	  (LISTP Y)
	  (EQUAL
	   (POWER-EVAL
		   (BIG-PLUS (CDR X)
			     (CDR Y)
			     (QUOTIENT (PLUS I (PLUS (CAR X) (CAR Y)))
				       BASE)
			     BASE)
		   BASE)
	   (PLUS (QUOTIENT (PLUS I (PLUS (CAR X) (CAR Y)))
			   BASE)
		 (PLUS (POWER-EVAL (CDR X) BASE)
		       (POWER-EVAL (CDR Y) BASE)))))
	 (EQUAL (POWER-EVAL (BIG-PLUS X Y I BASE)
			    BASE)
		(PLUS I
		      (PLUS (POWER-EVAL X BASE)
			    (POWER-EVAL Y BASE))))),

  which we simplify, applying ASSOCIATIVITY-OF-PLUS,
  COMMUTATIVITY-OF-PLUS, CDR-CONS, CAR-CONS, and
  COMMUTATIVITY2-OF-PLUS, and unfolding the functions BIG-PLUS and
  POWER-EVAL, to the new formula:

        (IMPLIES
	 (AND
	  (LISTP X)
	  (LISTP Y)
	  (EQUAL
	   (POWER-EVAL
		   (BIG-PLUS (CDR X)
			     (CDR Y)
			     (QUOTIENT (PLUS I (PLUS (CAR X) (CAR Y)))
				       BASE)
			     BASE)
		   BASE)
	   (PLUS (POWER-EVAL (CDR X) BASE)
		 (PLUS (POWER-EVAL (CDR Y) BASE)
		       (QUOTIENT (PLUS I (PLUS (CAR X) (CAR Y)))
				 BASE)))))
	 (EQUAL
	  (PLUS
	   (REMAINDER (PLUS I (PLUS (CAR X) (CAR Y)))
		      BASE)
	   (TIMES BASE
	    (POWER-EVAL
		   (BIG-PLUS (CDR X)
			     (CDR Y)
			     (QUOTIENT (PLUS I (PLUS (CAR X) (CAR Y)))
				       BASE)
			     BASE)
		   BASE)))
	  (PLUS I
	    (PLUS (CAR X)
		  (PLUS (CAR Y)
			(PLUS (TIMES BASE (POWER-EVAL (CDR X) BASE))
			      (TIMES BASE
				     (POWER-EVAL (CDR Y) BASE)))))))).

  Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS V Z)
  to eliminate (CDR X) and (CAR X).  This generates:

        (IMPLIES
	 (AND
	  (LISTP Y)
	  (EQUAL
	     (POWER-EVAL (BIG-PLUS Z
				   (CDR Y)
				   (QUOTIENT (PLUS I (PLUS V (CAR Y)))
					     BASE)
				   BASE)
			 BASE)
	     (PLUS (POWER-EVAL Z BASE)
		   (PLUS (POWER-EVAL (CDR Y) BASE)
			 (QUOTIENT (PLUS I (PLUS V (CAR Y)))
				   BASE)))))
	 (EQUAL
	  (PLUS
	   (REMAINDER (PLUS I (PLUS V (CAR Y)))
		      BASE)
	   (TIMES BASE
	     (POWER-EVAL (BIG-PLUS Z
				   (CDR Y)
				   (QUOTIENT (PLUS I (PLUS V (CAR Y)))
					     BASE)
				   BASE)
			 BASE)))
	  (PLUS I
	    (PLUS V
		  (PLUS (CAR Y)
			(PLUS (TIMES BASE (POWER-EVAL Z BASE))
			      (TIMES BASE
				     (POWER-EVAL (CDR Y) BASE)))))))).

  Applying the lemma CAR-CDR-ELIM, we now replace Y by (CONS D W) to
  eliminate (CDR Y) and (CAR Y).  We thus obtain:

        (IMPLIES
	 (EQUAL
	     (POWER-EVAL (BIG-PLUS Z W
				   (QUOTIENT (PLUS I (PLUS V D)) BASE)
				   BASE)
			 BASE)
	     (PLUS (POWER-EVAL Z BASE)
		   (PLUS (POWER-EVAL W BASE)
			 (QUOTIENT (PLUS I (PLUS V D)) BASE))))
	 (EQUAL
	  (PLUS
	   (REMAINDER (PLUS I (PLUS V D)) BASE)
	   (TIMES BASE
	     (POWER-EVAL (BIG-PLUS Z W
				   (QUOTIENT (PLUS I (PLUS V D)) BASE)
				   BASE)
			 BASE)))
	  (PLUS I
		(PLUS V
		      (PLUS D
			    (PLUS (TIMES BASE (POWER-EVAL Z BASE))
				  (TIMES BASE
					 (POWER-EVAL W BASE)))))))),

  which we further simplify, rewriting with COMMUTATIVITY-OF-PLUS and
  COMMUTATIVITY2-OF-PLUS, to:

        (IMPLIES
	 (EQUAL
	     (POWER-EVAL (BIG-PLUS Z W
				   (QUOTIENT (PLUS D (PLUS I V)) BASE)
				   BASE)
			 BASE)
	     (PLUS (POWER-EVAL W BASE)
		   (PLUS (POWER-EVAL Z BASE)
			 (QUOTIENT (PLUS D (PLUS I V)) BASE))))
	 (EQUAL
	  (PLUS
	   (REMAINDER (PLUS D (PLUS I V)) BASE)
	   (TIMES BASE
	     (POWER-EVAL (BIG-PLUS Z W
				   (QUOTIENT (PLUS D (PLUS I V)) BASE)
				   BASE)
			 BASE)))
	  (PLUS D
		(PLUS I
		      (PLUS V
			    (PLUS (TIMES BASE (POWER-EVAL W BASE))
				  (TIMES BASE
					 (POWER-EVAL Z BASE)))))))).

  We use the above equality hypothesis by substituting:
        (PLUS (POWER-EVAL W BASE)
	      (PLUS (POWER-EVAL Z BASE)
		    (QUOTIENT (PLUS D (PLUS I V)) BASE)))
  for:
        (POWER-EVAL (BIG-PLUS Z W
			      (QUOTIENT (PLUS D (PLUS I V)) BASE)
			      BASE)
		    BASE)
  and throwing away the equality.  This generates the new conjecture:

        (EQUAL
	 (PLUS (REMAINDER (PLUS D (PLUS I V)) BASE)
	       (TIMES BASE
		      (PLUS (POWER-EVAL W BASE)
			    (PLUS (POWER-EVAL Z BASE)
				  (QUOTIENT (PLUS D (PLUS I V))
					    BASE)))))
	 (PLUS D
	      (PLUS I
		    (PLUS V
			  (PLUS (TIMES BASE (POWER-EVAL W BASE))
				(TIMES BASE (POWER-EVAL Z BASE))))))),

  which we finally simplify, rewriting with
  DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, REMAINDER-QUOTIENT,
  ASSOCIATIVITY-OF-PLUS, COMMUTATIVITY-OF-PLUS, and
  COMMUTATIVITY2-OF-PLUS, to:

        T.

Case 2. (IMPLIES (AND (LISTP X) (NOT (LISTP Y)))
		 (EQUAL (POWER-EVAL (BIG-PLUS X Y I BASE)
				    BASE)
			(PLUS I
			      (PLUS (POWER-EVAL X BASE)
				    (POWER-EVAL Y BASE))))),

  which we simplify, applying COMMUTATIVITY-OF-PLUS,
  COMMUTATIVITY2-OF-PLUS, ASSOCIATIVITY-OF-PLUS, and
  POWER-EVAL-BIG-PLUS1, and expanding the definitions of BIG-PLUS,
  POWER-EVAL, EQUAL, and PLUS, to:

        T.

Case 1. (IMPLIES (NOT (LISTP X))
		 (EQUAL (POWER-EVAL (BIG-PLUS X Y I BASE)
				    BASE)
			(PLUS I
			      (PLUS (POWER-EVAL X BASE)
				    (POWER-EVAL Y BASE))))),

  which we simplify, rewriting with COMMUTATIVITY-OF-PLUS,
  POWER-EVAL-BIG-PLUS1, COMMUTATIVITY2-OF-PLUS, and
  CORRECTNESS-OF-CANCEL, and unfolding BIG-PLUS, POWER-EVAL, FIX, and
  EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 65.438001 0.61700033 ]

POWER-EVAL-BIG-PLUS 


(PROVE-LEMMA REMAINDER-WRT-1
	     (REWRITE)
	     (EQUAL (REMAINDER Y 1.) 0.))

     Call the conjecture *1.


     We will appeal to induction.  There is only one plausible
induction.  We will induct according to the following scheme:
      (AND (IMPLIES (ZEROP 1) (P Y))
	   (IMPLIES (AND (NOT (ZEROP 1)) (LESSP Y 1))
		    (P Y))
	   (IMPLIES (AND (NOT (ZEROP 1))
			 ( LEQ 1 Y)
			 (P (DIFFERENCE Y 1)))
		    (P Y))).
Linear arithmetic, the lemmas COUNT-NUMBERP and COUNT-NOT-LESSP, and
the definition of ZEROP establish that the measure (COUNT Y)
decreases according to the well-founded relation LESSP in each
induction step of the scheme.  The above induction scheme generates
three new goals:

Case 3. (IMPLIES (ZEROP 1)
		 (EQUAL (REMAINDER Y 1) 0)),

  which we simplify, unfolding ZEROP, to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP 1)) (LESSP Y 1))
		 (EQUAL (REMAINDER Y 1) 0)),

  which simplifies, expanding the definitions of ZEROP, REMAINDER,
  EQUAL, and NUMBERP, to:

        (IMPLIES (AND (LESSP Y 1) (NUMBERP Y))
		 (EQUAL Y 0)),

  which again simplifies, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP 1))
		      ( LEQ 1 Y)
		      (EQUAL (REMAINDER (DIFFERENCE Y 1) 1)
			     0))
		 (EQUAL (REMAINDER Y 1) 0)),

  which we simplify, unfolding ZEROP, REMAINDER, EQUAL, and NUMBERP,
  to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.35399984 0.193001302 ]

REMAINDER-WRT-1 


(PROVE-LEMMA REMAINDER-WRT-12
	     (REWRITE)
	     (IMPLIES (NOT (NUMBERP X))
		      (EQUAL (REMAINDER Y X) (FIX Y))))
This formula simplifies, unfolding REMAINDER and FIX, to:

      T.

Q.E.D.


[ 0.067000326 0.0150024414 ]

REMAINDER-WRT-12 


(PROVE-LEMMA LESSP-REMAINDER2
	     (REWRITE GENERALIZE)
	     (EQUAL (LESSP (REMAINDER X Y) Y)
		    (NOT (ZEROP Y))))
This formula simplifies, applying EQUAL-LESSP, and opening up ZEROP
and NOT, to the following three new goals:

Case 3. (IMPLIES (AND ( LEQ Y (REMAINDER X Y))
		      (NOT (EQUAL Y 0)))
		 (NOT (NUMBERP Y))),

  which we will name *1.

Case 2. (IMPLIES (LESSP (REMAINDER X Y) Y)
		 (NUMBERP Y)),

  which again simplifies, rewriting with REMAINDER-WRT-12, and
  opening up the function LESSP, to:

        T.

Case 1. (IMPLIES (LESSP (REMAINDER X Y) Y)
		 (NOT (EQUAL Y 0))),

  which again simplifies, using linear arithmetic, to:

        T.


     So we now return to:

      (IMPLIES (AND ( LEQ Y (REMAINDER X Y))
		    (NOT (EQUAL Y 0)))
	       (NOT (NUMBERP Y))),

which we named *1 above.  We will appeal to induction.  Two
inductions are suggested by terms in the conjecture.  However, only
one is unflawed.  We will induct according to the following scheme:
      (AND (IMPLIES (ZEROP Y) (P Y X))
	   (IMPLIES (AND (NOT (ZEROP Y)) (LESSP X Y))
		    (P Y X))
	   (IMPLIES (AND (NOT (ZEROP Y))
			 ( LEQ Y X)
			 (P Y (DIFFERENCE X Y)))
		    (P Y X))).
Linear arithmetic, the lemmas COUNT-NUMBERP and COUNT-NOT-LESSP, and
the definition of ZEROP establish that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each
induction step of the scheme.  The above induction scheme generates
three new formulas:

Case 3. (IMPLIES (AND (ZEROP Y)
		      ( LEQ Y (REMAINDER X Y))
		      (NOT (EQUAL Y 0)))
		 (NOT (NUMBERP Y))),

  which we simplify, unfolding ZEROP, to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP Y))
		      (LESSP X Y)
		      ( LEQ Y (REMAINDER X Y))
		      (NOT (EQUAL Y 0)))
		 (NOT (NUMBERP Y))).

  This simplifies, opening up ZEROP and REMAINDER, to:

        (IMPLIES (AND (LESSP X Y)
		      (NOT (NUMBERP X))
		      ( LEQ Y 0)
		      (NOT (EQUAL Y 0)))
		 (NOT (NUMBERP Y))),

  which we again simplify, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP Y))
		      ( LEQ Y X)
		      (LESSP (REMAINDER (DIFFERENCE X Y) Y)
			     Y)
		      ( LEQ Y (REMAINDER X Y))
		      (NOT (EQUAL Y 0)))
		 (NOT (NUMBERP Y))),

  which we simplify, unfolding the definitions of ZEROP and REMAINDER,
  to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 2.0720052 0.304996744 ]

LESSP-REMAINDER2 


(PROVE-LEMMA REMAINDER-X-X
	     (REWRITE)
	     (EQUAL (REMAINDER X X) 0.))
This simplifies, applying the lemma DIFFERENCE-0, and expanding the
definitions of NUMBERP, REMAINDER, LESSP, and EQUAL, to:

      (IMPLIES (AND (NOT (EQUAL X 0)) (NUMBERP X))
	       ( LEQ X X)).

But this simplifies again, using linear arithmetic, to:

      T.

Q.E.D.


[ 0.222005209 0.0419962564 ]

REMAINDER-X-X 


(PROVE-LEMMA REMAINDER-QUOTIENT-ELIM
	     (ELIM)
	     (IMPLIES (AND (NOT (ZEROP Y)) (NUMBERP X))
		      (EQUAL (PLUS (REMAINDER X Y)
				   (TIMES Y (QUOTIENT X Y)))
			     X)))
This formula can be simplified, using the abbreviations ZEROP, NOT,
AND, and IMPLIES, to:

      (IMPLIES (AND (NOT (EQUAL Y 0))
		    (NUMBERP Y)
		    (NUMBERP X))
	       (EQUAL (PLUS (REMAINDER X Y)
			    (TIMES Y (QUOTIENT X Y)))
		      X)).

This simplifies, applying REMAINDER-QUOTIENT, to:

      T.

Q.E.D.


[ 0.661002606 0.0419962564 ]

REMAINDER-QUOTIENT-ELIM 


(PROVE-LEMMA LESSP-TIMES-1
	     (REWRITE)
	     (IMPLIES (NOT (ZEROP I))
		      ( LEQ J (TIMES I J))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT,
and IMPLIES, to:

      (IMPLIES (AND (NOT (EQUAL I 0)) (NUMBERP I))
	       ( LEQ J (TIMES I J))).

Give the above formula the name *1.


     We will try to prove it by induction.  Two inductions are
suggested by terms in the conjecture.  However, only one is unflawed.
We will induct according to the following scheme:
      (AND (IMPLIES (ZEROP I) (P I J))
	   (IMPLIES (AND (NOT (ZEROP I)) (P (SUB1 I) J))
		    (P I J))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP establish that the measure (COUNT I) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme leads to the following three new goals:

Case 3. (IMPLIES (AND (ZEROP I)
		      (NOT (EQUAL I 0))
		      (NUMBERP I))
		 ( LEQ J (TIMES I J))),

  which simplifies, unfolding the definition of ZEROP, to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP I))
		      (EQUAL (SUB1 I) 0)
		      (NOT (EQUAL I 0))
		      (NUMBERP I))
		 ( LEQ J (TIMES I J))).

  This simplifies, expanding the definitions of ZEROP and TIMES, to
  the formula:

        (IMPLIES (AND (EQUAL (SUB1 I) 0)
		      (NOT (EQUAL I 0))
		      (NUMBERP I))
		 ( LEQ J (PLUS J (TIMES (SUB1 I) J)))),

  which again simplifies, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP I))
		      ( LEQ J (TIMES (SUB1 I) J))
		      (NOT (EQUAL I 0))
		      (NUMBERP I))
		 ( LEQ J (TIMES I J))),

  which simplifies, opening up the functions ZEROP and TIMES, to:

        (IMPLIES (AND ( LEQ J (TIMES (SUB1 I) J))
		      (NOT (EQUAL I 0))
		      (NUMBERP I))
		 ( LEQ J (PLUS J (TIMES (SUB1 I) J)))).

  However this simplifies again, using linear arithmetic, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.69698893 0.253011066 ]

LESSP-TIMES-1 


(PROVE-LEMMA LESSP-TIMES-2
	     (REWRITE)
	     (IMPLIES (NOT (ZEROP I))
		      ( LEQ J (TIMES J I))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT,
and IMPLIES, to:

      (IMPLIES (AND (NOT (EQUAL I 0)) (NUMBERP I))
	       ( LEQ J (TIMES J I))).

This simplifies, applying COMMUTATIVITY-OF-TIMES, to:

      (IMPLIES (AND (NOT (EQUAL I 0)) (NUMBERP I))
	       ( LEQ J (TIMES I J))).

However this again simplifies, using linear arithmetic and applying
the lemma LESSP-TIMES-1, to:

      T.

Q.E.D.


[ 0.274003092 0.0619954425 ]

LESSP-TIMES-2 


(PROVE-LEMMA LESSP-QUOTIENT1
	     (REWRITE)
	     (EQUAL (LESSP (QUOTIENT I J) I)
		    (AND (NOT (ZEROP I))
			 (OR (ZEROP J) (NOT (EQUAL J 1.))))))
This formula simplifies, rewriting with EQUAL-LESSP, and unfolding
the functions ZEROP, NOT, OR, and AND, to six new conjectures:

Case 6. (IMPLIES (AND ( LEQ I (QUOTIENT I J))
		      (NOT (EQUAL I 0))
		      (NUMBERP I))
		 (NOT (EQUAL J 0))).

  However this again simplifies, opening up the definitions of EQUAL,
  QUOTIENT, and LESSP, to:

        T.

Case 5. (IMPLIES (AND ( LEQ I (QUOTIENT I J))
		      (NOT (EQUAL I 0))
		      (NUMBERP I))
		 (NUMBERP J)).

  However this simplifies again, opening up the definitions of
  QUOTIENT, EQUAL, and LESSP, to:

        T.

Case 4. (IMPLIES (AND ( LEQ I (QUOTIENT I J))
		      (NOT (EQUAL I 0))
		      (NUMBERP I))
		 (EQUAL J 1)).

  Applying the lemma REMAINDER-QUOTIENT-ELIM, we now replace I by
  (PLUS Z (TIMES J X)) to eliminate (QUOTIENT I J) and
  (REMAINDER I J).  We use LESSP-REMAINDER2, the type restriction
  lemma noted when QUOTIENT was introduced, and the type restriction
  lemma noted when REMAINDER was introduced to restrict the new
  variables.  This produces three new formulas:

  Case 4.3.
          (IMPLIES (AND (EQUAL J 0)
			( LEQ I (QUOTIENT I J))
			(NOT (EQUAL I 0))
			(NUMBERP I))
		   (EQUAL J 1)),

    which further simplifies, opening up the functions EQUAL,
    QUOTIENT, and LESSP, to:

          T.

  Case 4.2.
          (IMPLIES (AND (NOT (NUMBERP J))
			( LEQ I (QUOTIENT I J))
			(NOT (EQUAL I 0))
			(NUMBERP I))
		   (EQUAL J 1)),

    which further simplifies, unfolding the definitions of QUOTIENT,
    EQUAL, and LESSP, to:

          T.

  Case 4.1.
          (IMPLIES (AND (NUMBERP X)
			(NUMBERP Z)
			(EQUAL (LESSP Z J) (NOT (ZEROP J)))
			(NUMBERP J)
			(NOT (EQUAL J 0))
			( LEQ (PLUS Z (TIMES J X)) X)
			(NOT (EQUAL (PLUS Z (TIMES J X)) 0)))
		   (EQUAL J 1)),

    which we further simplify, rewriting with EQUAL-TIMES-0 and
    PLUS-EQUAL-0, and expanding the definitions of ZEROP and NOT, to
    two new conjectures:

    Case 4.1.2.
            (IMPLIES (AND (NUMBERP X)
			  (NUMBERP Z)
			  (LESSP Z J)
			  (NUMBERP J)
			  (NOT (EQUAL J 0))
			  ( LEQ (PLUS Z (TIMES J X)) X)
			  (NOT (EQUAL Z 0)))
		     (EQUAL J 1)),

      which we again simplify, using linear arithmetic and rewriting
      with LESSP-TIMES-1, to:

            T.

    Case 4.1.1.
            (IMPLIES (AND (NUMBERP X)
			  (NUMBERP Z)
			  (LESSP Z J)
			  (NUMBERP J)
			  (NOT (EQUAL J 0))
			  ( LEQ (PLUS Z (TIMES J X)) X)
			  (NOT (EQUAL X 0)))
		     (EQUAL J 1)),

      which we would usually push and work on later by induction.
      But if we must use induction to prove the input conjecture, we
      prefer to induct on the original formulation of the problem.
      Thus we will disregard all that we have previously done, give
      the name *1 to the original input, and work on it.


     So now let us consider:

(EQUAL (LESSP (QUOTIENT I J) I)
       (AND (NOT (ZEROP I))
	    (OR (ZEROP J) (NOT (EQUAL J 1))))),

which we named *1 above.  Let us appeal to the induction principle.
Two inductions are suggested by terms in the conjecture, both of
which are unflawed.  So we will choose the one suggested by the
largest number of nonprimitive recursive functions.  We will induct
according to the following scheme:
      (AND (IMPLIES (ZEROP J) (P I J))
	   (IMPLIES (AND (NOT (ZEROP J)) (LESSP I J))
		    (P I J))
	   (IMPLIES (AND (NOT (ZEROP J))
			 ( LEQ J I)
			 (P (DIFFERENCE I J) J))
		    (P I J))).
Linear arithmetic, the lemmas COUNT-NUMBERP and COUNT-NOT-LESSP, and
the definition of ZEROP inform us that the measure (COUNT I)
decreases according to the well-founded relation LESSP in each
induction step of the scheme.  The above induction scheme leads to
the following three new goals:

Case 3. (IMPLIES (ZEROP J)
		 (EQUAL (LESSP (QUOTIENT I J) I)
			(AND (NOT (ZEROP I))
			     (OR (ZEROP J) (NOT (EQUAL J 1)))))),

  which simplifies, expanding the functions ZEROP, EQUAL, QUOTIENT,
  LESSP, NOT, OR, and AND, to the following four new formulas:

  Case 3.4.
          (IMPLIES (AND (EQUAL J 0)
			(NOT (EQUAL I 0))
			(NOT (NUMBERP I)))
		   (EQUAL (NUMBERP I) F)),

    which we again simplify, obviously, to:

          T.

  Case 3.3.
          (IMPLIES (AND (EQUAL J 0)
			(NOT (EQUAL I 0))
			(NUMBERP I))
		   (EQUAL (NUMBERP I) T)),

    which we again simplify, trivially, to:

          T.

  Case 3.2.
          (IMPLIES (AND (NOT (NUMBERP J))
			(NOT (EQUAL I 0))
			(NOT (NUMBERP I)))
		   (EQUAL (NUMBERP I) F)),

    which again simplifies, clearly, to:

          T.

  Case 3.1.
          (IMPLIES (AND (NOT (NUMBERP J))
			(NOT (EQUAL I 0))
			(NUMBERP I))
		   (EQUAL (NUMBERP I) T)).

    This again simplifies, trivially, to:

          T.

Case 2. (IMPLIES (AND (NOT (ZEROP J)) (LESSP I J))
		 (EQUAL (LESSP (QUOTIENT I J) I)
			(AND (NOT (ZEROP I))
			     (OR (ZEROP J) (NOT (EQUAL J 1)))))).

  This simplifies, opening up the functions ZEROP, QUOTIENT, EQUAL,
  LESSP, NOT, OR, and AND, to the following three new goals:

  Case 2.3.
          (IMPLIES (AND (NOT (EQUAL J 0))
			(NUMBERP J)
			(LESSP I J)
			(NOT (EQUAL I 0))
			(EQUAL J 1))
		   (EQUAL (NUMBERP I) F)),

    which we again simplify, using linear arithmetic, to the new goal:

          (IMPLIES (AND (NOT (NUMBERP I))
			(NOT (EQUAL 1 0))
			(NUMBERP 1)
			(LESSP I 1)
			(NOT (EQUAL I 0)))
		   (EQUAL (NUMBERP I) F)),

    which we again simplify, trivially, to:

          T.

  Case 2.2.
          (IMPLIES (AND (NOT (EQUAL J 0))
			(NUMBERP J)
			(LESSP I J)
			(NOT (EQUAL I 0))
			(NOT (NUMBERP I)))
		   (EQUAL (NUMBERP I) F)),

    which we again simplify, obviously, to:

          T.

  Case 2.1.
          (IMPLIES (AND (NOT (EQUAL J 0))
			(NUMBERP J)
			(LESSP I J)
			(NOT (EQUAL I 0))
			(NUMBERP I)
			(NOT (EQUAL J 1)))
		   (EQUAL (NUMBERP I) T)),

    which again simplifies, obviously, to:

          T.

Case 1. (IMPLIES (AND (NOT (ZEROP J))
		      ( LEQ J I)
		      (EQUAL (LESSP (QUOTIENT (DIFFERENCE I J) J)
				    (DIFFERENCE I J))
			     (AND (NOT (ZEROP (DIFFERENCE I J)))
				  (OR (ZEROP J) (NOT (EQUAL J 1))))))
		 (EQUAL (LESSP (QUOTIENT I J) I)
			(AND (NOT (ZEROP I))
			     (OR (ZEROP J) (NOT (EQUAL J 1)))))).

  This simplifies, applying the lemmas EQUAL-DIFFERENCE-0,
  EQUAL-LESSP, and SUB1-ADD1, and opening up ZEROP, NOT, OR, AND,
  EQUAL, QUOTIENT, and LESSP, to the following four new conjectures:

  Case 1.4.
          (IMPLIES (AND (NOT (EQUAL J 0))
			(NUMBERP J)
			( LEQ J I)
			( LEQ
			  (DIFFERENCE I J)
			  (QUOTIENT (DIFFERENCE I J) J))
			(EQUAL J 1))
		   ( LEQ I (QUOTIENT I 1))).

    This again simplifies, opening up EQUAL and NUMBERP, to:

          (IMPLIES (AND ( LEQ 1 I)
			( LEQ
			  (DIFFERENCE I 1)
			  (QUOTIENT (DIFFERENCE I 1) 1)))
		   ( LEQ I (QUOTIENT I 1))).

    This simplifies again, applying the lemma SUB1-ADD1, and
    expanding the functions NUMBERP, EQUAL, QUOTIENT, and LESSP, to
    the formula:

          (IMPLIES (AND ( LEQ 1 I)
			( LEQ
			  (DIFFERENCE I 1)
			  (QUOTIENT (DIFFERENCE I 1) 1))
			(NOT (EQUAL I 0))
			(NUMBERP I))
		   ( LEQ
		     (SUB1 I)
		     (QUOTIENT (DIFFERENCE I 1) 1))).

    This simplifies again, using linear arithmetic, to:

          T.

  Case 1.3.
          (IMPLIES (AND (NOT (EQUAL J 0))
			(NUMBERP J)
			( LEQ J I)
			( LEQ
			  (DIFFERENCE I J)
			  (QUOTIENT (DIFFERENCE I J) J))
			( LEQ I J)
			(NOT (EQUAL I 0))
			(NUMBERP I)
			(EQUAL J 1))
		   (EQUAL (LESSP (QUOTIENT (DIFFERENCE I J) J)
				 (SUB1 I))
			  F)).

    This simplifies again, using linear arithmetic, to the new
    conjecture:

          (IMPLIES (AND (NOT (EQUAL 1 0))
			(NUMBERP 1)
			( LEQ 1 1)
			( LEQ
			  (DIFFERENCE 1 1)
			  (QUOTIENT (DIFFERENCE 1 1) 1))
			( LEQ 1 1)
			(NOT (EQUAL 1 0))
			(NUMBERP 1))
		   (EQUAL (LESSP (QUOTIENT (DIFFERENCE 1 1) 1)
				 (SUB1 1))
			  F)).

    However this simplifies again, expanding the functions EQUAL,
    NUMBERP, LESSP, DIFFERENCE, QUOTIENT, and SUB1, to:

          T.

  Case 1.2.
          (IMPLIES (AND (NOT (EQUAL J 0))
			(NUMBERP J)
			( LEQ J I)
			( LEQ
			  (DIFFERENCE I J)
			  (QUOTIENT (DIFFERENCE I J) J))
			( LEQ I J)
			(NOT (EQUAL I 0))
			(NUMBERP I)
			(NOT (EQUAL J 1)))
		   (EQUAL (LESSP (QUOTIENT (DIFFERENCE I J) J)
				 (SUB1 I))
			  T)),

    which again simplifies, using linear arithmetic, to the new goal:

          (IMPLIES (AND (NOT (EQUAL I 0))
			(NUMBERP I)
			( LEQ I I)
			( LEQ
			  (DIFFERENCE I I)
			  (QUOTIENT (DIFFERENCE I I) I))
			( LEQ I I)
			(NOT (EQUAL I 0))
			(NUMBERP I)
			(NOT (EQUAL I 1)))
		   (EQUAL (LESSP (QUOTIENT (DIFFERENCE I I) I)
				 (SUB1 I))
			  T)),

    which again simplifies, rewriting with DIFFERENCE-0, and opening
    up the functions LESSP, EQUAL, and QUOTIENT, to:

          (IMPLIES (AND ( LEQ I I)
			(NOT (EQUAL I 0))
			(NUMBERP I)
			(NOT (EQUAL I 1)))
		   (NOT (EQUAL (SUB1 I) 0))).

    This again simplifies, using linear arithmetic, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NOT (EQUAL J 0))
			(NUMBERP J)
			( LEQ J I)
			(LESSP (QUOTIENT (DIFFERENCE I J) J)
			       (DIFFERENCE I J))
			(LESSP J I)
			(NOT (EQUAL J 1))
			(NOT (EQUAL I 0))
			(NUMBERP I))
		   (EQUAL (LESSP (QUOTIENT (DIFFERENCE I J) J)
				 (SUB1 I))
			  T)),

    which we again simplify, obviously, to:

          (IMPLIES (AND (NOT (EQUAL J 0))
			(NUMBERP J)
			( LEQ J I)
			(LESSP (QUOTIENT (DIFFERENCE I J) J)
			       (DIFFERENCE I J))
			(LESSP J I)
			(NOT (EQUAL J 1))
			(NOT (EQUAL I 0))
			(NUMBERP I))
		   (LESSP (QUOTIENT (DIFFERENCE I J) J)
			  (SUB1 I))).

    This again simplifies, using linear arithmetic, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 9.1569946 1.17600098 ]

LESSP-QUOTIENT1 


(PROVE-LEMMA LESSP-REMAINDER1
	     (REWRITE)
	     (EQUAL (LESSP (REMAINDER X Y) X)
		    (AND (NOT (ZEROP Y))
			 (NOT (ZEROP X))
			 ( LEQ Y X))))
This formula simplifies, rewriting with EQUAL-LESSP, and unfolding
the functions ZEROP, NOT, and AND, to six new conjectures:

Case 6. (IMPLIES (AND ( LEQ X (REMAINDER X Y))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL X 0))
		      (NUMBERP X))
		 (LESSP X Y)).

  Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace X by
  (PLUS Z (TIMES Y V)) to eliminate (REMAINDER X Y) and
  (QUOTIENT X Y).  We use LESSP-REMAINDER2, the type restriction
  lemma noted when REMAINDER was introduced, and the type restriction
  lemma noted when QUOTIENT was introduced to constrain the new
  variables.  We would thus like to prove:

        (IMPLIES (AND (NUMBERP Z)
		      (EQUAL (LESSP Z Y) (NOT (ZEROP Y)))
		      (NUMBERP V)
		      ( LEQ (PLUS Z (TIMES Y V)) Z)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL (PLUS Z (TIMES Y V)) 0)))
		 (LESSP (PLUS Z (TIMES Y V)) Y)).

  This further simplifies, applying COMMUTATIVITY-OF-TIMES,
  EQUAL-TIMES-0, and PLUS-EQUAL-0, and expanding the definitions of
  ZEROP and NOT, to two new formulas:

  Case 6.2.
          (IMPLIES (AND (NUMBERP Z)
			(LESSP Z Y)
			(NUMBERP V)
			( LEQ (PLUS Z (TIMES V Y)) Z)
			(NOT (EQUAL Y 0))
			(NUMBERP Y)
			(NOT (EQUAL Z 0)))
		   (LESSP (PLUS Z (TIMES V Y)) Y)),

    which we again simplify, using linear arithmetic, to:

          T.

  Case 6.1.
          (IMPLIES (AND (NUMBERP Z)
			(LESSP Z Y)
			(NUMBERP V)
			( LEQ (PLUS Z (TIMES V Y)) Z)
			(NOT (EQUAL Y 0))
			(NUMBERP Y)
			(NOT (EQUAL V 0)))
		   (LESSP (PLUS Z (TIMES V Y)) Y)).

    However this again simplifies, using linear arithmetic, to:

          T.

Case 5. (IMPLIES (LESSP (REMAINDER X Y) X)
		 ( LEQ Y X)).

  But this simplifies again, expanding REMAINDER and LESSP, to two
  new formulas:

  Case 5.2.
          (IMPLIES (AND (NOT (NUMBERP X))
			(LESSP 0 X)
			(NOT (EQUAL Y 0)))
		   (NOT (NUMBERP Y))),

    which we again simplify, expanding the definition of LESSP, to:

          T.

  Case 5.1.
          (IMPLIES (AND (NUMBERP X) (LESSP X X))
		   ( LEQ Y X)),

    which we again simplify, using linear arithmetic, to:

          T.

Case 4. (IMPLIES (LESSP (REMAINDER X Y) X)
		 (NUMBERP X)),

  which we again simplify, unfolding LESSP and REMAINDER, to:

        T.

Case 3. (IMPLIES (LESSP (REMAINDER X Y) X)
		 (NOT (EQUAL X 0))),

  which again simplifies, using linear arithmetic, to:

        T.

Case 2. (IMPLIES (LESSP (REMAINDER X Y) X)
		 (NUMBERP Y)),

  which we again simplify, applying REMAINDER-WRT-12, to the
  following two new formulas:

  Case 2.2.
          (IMPLIES (AND (NOT (NUMBERP X)) (LESSP 0 X))
		   (NUMBERP Y)).

    But this simplifies again, unfolding the definition of LESSP, to:

          T.

  Case 2.1.
          (IMPLIES (AND (NUMBERP X) (LESSP X X))
		   (NUMBERP Y)),

    which again simplifies, using linear arithmetic, to:

          T.

Case 1. (IMPLIES (LESSP (REMAINDER X Y) X)
		 (NOT (EQUAL Y 0))),

  which we again simplify, opening up EQUAL and REMAINDER, to two new
  conjectures:

  Case 1.2.
          (IMPLIES (NOT (NUMBERP X))
		   ( LEQ X 0)).

    However this again simplifies, expanding the function LESSP, to:

          T.

  Case 1.1.
          (IMPLIES (NUMBERP X) ( LEQ X X)),

    which again simplifies, using linear arithmetic, to:

          T.

Q.E.D.


[ 3.57399088 0.427010093 ]

LESSP-REMAINDER1 


(DEFN POWER-REP
      (I BASE)
      (IF (ZEROP I)
	  NIL
	  (IF (ZEROP BASE)
	      (CONS I NIL)
	      (IF (EQUAL BASE 1.)
		  (CONS I NIL)
		  (CONS (REMAINDER I BASE)
			(POWER-REP (QUOTIENT I BASE)
				   BASE))))))
     The lemmas LESSP-QUOTIENT1 and COUNT-NUMBERP and the definition
of ZEROP can be used to prove that the measure (COUNT I) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, POWER-REP is accepted under the principle of definition.
Observe that:
      (OR (LITATOM (POWER-REP I BASE))
	  (LISTP (POWER-REP I BASE)))
is a theorem.




[ 0.457991537 0.05 ]

POWER-REP 


(PROVE-LEMMA POWER-EVAL-POWER-REP
	     (REWRITE)
	     (EQUAL (POWER-EVAL (POWER-REP I BASE) BASE)
		    (FIX I)))
This simplifies, opening up the function FIX, to the following two
new goals:

Case 2. (IMPLIES (NOT (NUMBERP I))
		 (EQUAL (POWER-EVAL (POWER-REP I BASE) BASE)
			0)),

  which again simplifies, opening up the definitions of POWER-REP,
  LISTP, POWER-EVAL, and EQUAL, to:

        T.

Case 1. (IMPLIES (NUMBERP I)
		 (EQUAL (POWER-EVAL (POWER-REP I BASE) BASE)
			I)),

  which we will name *1.


     Perhaps we can prove it by induction.  There is only one
plausible induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (ZEROP I) (P I BASE))
	   (IMPLIES (AND (NOT (ZEROP I)) (ZEROP BASE))
		    (P I BASE))
	   (IMPLIES (AND (NOT (ZEROP I))
			 (NOT (ZEROP BASE))
			 (EQUAL BASE 1))
		    (P I BASE))
	   (IMPLIES (AND (NOT (ZEROP I))
			 (NOT (ZEROP BASE))
			 (NOT (EQUAL BASE 1))
			 (P (QUOTIENT I BASE) BASE))
		    (P I BASE))).
The lemmas LESSP-QUOTIENT1 and COUNT-NUMBERP and the definition of
ZEROP inform us that the measure (COUNT I) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme produces four new formulas:

Case 4. (IMPLIES (AND (ZEROP I) (NUMBERP I))
		 (EQUAL (POWER-EVAL (POWER-REP I BASE) BASE)
			I)).

  This simplifies, opening up the definitions of ZEROP, NUMBERP,
  EQUAL, POWER-REP, LISTP, and POWER-EVAL, to:

        T.

Case 3. (IMPLIES (AND (NOT (ZEROP I))
		      (ZEROP BASE)
		      (NUMBERP I))
		 (EQUAL (POWER-EVAL (POWER-REP I BASE) BASE)
			I)),

  which we simplify, rewriting with the lemmas COMMUTATIVITY-OF-PLUS,
  CDR-CONS, and CAR-CONS, and unfolding the functions ZEROP, EQUAL,
  POWER-REP, PLUS, TIMES, and POWER-EVAL, to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP I))
		      (NOT (ZEROP BASE))
		      (EQUAL BASE 1)
		      (NUMBERP I))
		 (EQUAL (POWER-EVAL (POWER-REP I BASE) BASE)
			I)).

  This simplifies, appealing to the lemmas COMMUTATIVITY-OF-PLUS,
  CDR-CONS, and CAR-CONS, and opening up ZEROP, NUMBERP, EQUAL,
  POWER-REP, PLUS, TIMES, and POWER-EVAL, to:

        T.

Case 1. (IMPLIES
	    (AND (NOT (ZEROP I))
		 (NOT (ZEROP BASE))
		 (NOT (EQUAL BASE 1))
		 (EQUAL (POWER-EVAL (POWER-REP (QUOTIENT I BASE) BASE)
				    BASE)
			(QUOTIENT I BASE))
		 (NUMBERP I))
	    (EQUAL (POWER-EVAL (POWER-REP I BASE) BASE)
		   I)).

  This simplifies, applying REMAINDER-QUOTIENT, CDR-CONS, and
  CAR-CONS, and unfolding the functions ZEROP, POWER-REP, and
  POWER-EVAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 3.29999188 0.32801107 ]

POWER-EVAL-POWER-REP 


(PROVE-LEMMA CORRECTNESS-OF-BIG-PLUS
	     (REWRITE)
	     (EQUAL (POWER-EVAL (BIG-PLUS (POWER-REP I BASE)
					  (POWER-REP J BASE)
					  0. BASE)
				BASE)
		    (PLUS I J)))
This formula can be simplified, using the abbreviation
POWER-EVAL-BIG-PLUS, to:

      (EQUAL (PLUS 0
		   (PLUS (POWER-EVAL (POWER-REP I BASE) BASE)
			 (POWER-EVAL (POWER-REP J BASE) BASE)))
	     (PLUS I J)),

which simplifies, applying the lemma POWER-EVAL-POWER-REP, to the
following four new formulas:

Case 4. (IMPLIES (AND (NOT (NUMBERP J))
		      (NOT (NUMBERP I)))
		 (EQUAL (PLUS 0 (PLUS 0 0))
			(PLUS I J))),

  which again simplifies, applying PLUS-RIGHT-ID2, and expanding the
  definitions of PLUS and EQUAL, to:

        T.

Case 3. (IMPLIES (AND (NOT (NUMBERP J)) (NUMBERP I))
		 (EQUAL (PLUS 0 (PLUS I 0))
			(PLUS I J))),

  which again simplifies, rewriting with COMMUTATIVITY-OF-PLUS and
  PLUS-RIGHT-ID2, and opening up EQUAL and PLUS, to:

        T.

Case 2. (IMPLIES (AND (NUMBERP J) (NOT (NUMBERP I)))
		 (EQUAL (PLUS 0 (PLUS 0 J))
			(PLUS I J))),

  which again simplifies, opening up the functions EQUAL and PLUS, to:

        T.

Case 1. (IMPLIES (AND (NUMBERP J) (NUMBERP I))
		 (EQUAL (PLUS 0 (PLUS I J))
			(PLUS I J))),

  which again simplifies, using linear arithmetic, to:

        T.

Q.E.D.


[ 1.24598795 0.143009441 ]

CORRECTNESS-OF-BIG-PLUS 


(DEFN GCD
      (X Y)
      (IF (ZEROP X)
	  (FIX Y)
	  (IF (ZEROP Y)
	      X
	      (IF (LESSP X Y)
		  (GCD X (DIFFERENCE Y X))
		  (GCD (DIFFERENCE X Y) Y))))
      ((LEX2 (LIST (COUNT X) (COUNT Y)))))
     Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, COUNT-NUMBERP,
and DIFFERENCE-CANCELLATION-0, and the definitions of LEX2 and ZEROP
can be used to prove that the measure (LIST (COUNT X) (COUNT Y))
decreases according to the well-founded relation LEX2 in each
recursive call.  Hence, GCD is accepted under the principle of
definition.  Observe that (NUMBERP (GCD X Y)) is a theorem.




[ 0.99099935 0.0540039064 ]

GCD 


(PROVE-LEMMA NUMBERP-GCD
	     (REWRITE)
	     (NUMBERP (GCD X Y)))
This simplifies, obviously, to:

      T.

Q.E.D.


[ 0.0300048827 0.0119954427 ]

NUMBERP-GCD 


(PROVE-LEMMA GCD-EQUAL-0
	     (REWRITE)
	     (EQUAL (EQUAL (GCD X Y) 0.)
		    (AND (ZEROP X) (ZEROP Y))))
This simplifies, unfolding the functions ZEROP and AND, to six new
conjectures:

Case 6. (IMPLIES (AND (NOT (EQUAL (GCD X Y) 0))
		      (NOT (NUMBERP X)))
		 (NOT (EQUAL Y 0))).

  However this again simplifies, opening up the definitions of
  NUMBERP, GCD, and EQUAL, to:

        T.

Case 5. (IMPLIES (AND (NOT (EQUAL (GCD X Y) 0))
		      (NOT (NUMBERP X)))
		 (NUMBERP Y)).

  However this simplifies again, opening up the definitions of GCD
  and EQUAL, to:

        T.

Case 4. (IMPLIES (AND (NOT (EQUAL (GCD X Y) 0))
		      (EQUAL X 0))
		 (NOT (EQUAL Y 0))),

  which we again simplify, opening up GCD and EQUAL, to:

        T.

Case 3. (IMPLIES (AND (NOT (EQUAL (GCD X Y) 0))
		      (EQUAL X 0))
		 (NUMBERP Y)),

  which we again simplify, unfolding EQUAL and GCD, to:

        T.

Case 2. (IMPLIES (AND (EQUAL (GCD X Y) 0)
		      (NOT (EQUAL X 0)))
		 (NOT (NUMBERP X))).

  Give the above formula the name *1.

Case 1. (IMPLIES (AND (EQUAL (GCD X Y) 0)
		      (NOT (EQUAL Y 0)))
		 (NOT (NUMBERP Y))),

  which we would usually push and work on later by induction.  But if
  we must use induction to prove the input conjecture, we prefer to
  induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us consider:

(EQUAL (EQUAL (GCD X Y) 0)
       (AND (ZEROP X) (ZEROP Y))),

which we named *1 above.  We will try to prove it by induction.
There is only one plausible induction.  We will induct according to
the following scheme:
      (AND (IMPLIES (ZEROP X) (P X Y))
	   (IMPLIES (AND (NOT (ZEROP X)) (ZEROP Y))
		    (P X Y))
	   (IMPLIES (AND (NOT (ZEROP X))
			 (NOT (ZEROP Y))
			 (LESSP X Y)
			 (P X (DIFFERENCE Y X)))
		    (P X Y))
	   (IMPLIES (AND (NOT (ZEROP X))
			 (NOT (ZEROP Y))
			 ( LEQ Y X)
			 (P (DIFFERENCE X Y) Y))
		    (P X Y))).
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, COUNT-NUMBERP, and
DIFFERENCE-CANCELLATION-0, and the definitions of LEX2 and ZEROP
inform us that the measure (LIST (COUNT X) (COUNT Y)) decreases
according to the well-founded relation LEX2 in each induction step of
the scheme.  The above induction scheme leads to four new conjectures:

Case 4. (IMPLIES (ZEROP X)
		 (EQUAL (EQUAL (GCD X Y) 0)
			(AND (ZEROP X) (ZEROP Y)))),

  which we simplify, opening up ZEROP, EQUAL, GCD, and AND, to:

        T.

Case 3. (IMPLIES (AND (NOT (ZEROP X)) (ZEROP Y))
		 (EQUAL (EQUAL (GCD X Y) 0)
			(AND (ZEROP X) (ZEROP Y)))),

  which simplifies, expanding the definitions of ZEROP, EQUAL, GCD,
  and AND, to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP X))
		      (NOT (ZEROP Y))
		      (LESSP X Y)
		      (EQUAL (EQUAL (GCD X (DIFFERENCE Y X)) 0)
			     (AND (ZEROP X)
				  (ZEROP (DIFFERENCE Y X)))))
		 (EQUAL (EQUAL (GCD X Y) 0)
			(AND (ZEROP X) (ZEROP Y)))),

  which we simplify, applying EQUAL-DIFFERENCE-0, and opening up
  ZEROP, AND, GCD, and EQUAL, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP X))
		      (NOT (ZEROP Y))
		      ( LEQ Y X)
		      (EQUAL (EQUAL (GCD (DIFFERENCE X Y) Y) 0)
			     (AND (ZEROP (DIFFERENCE X Y))
				  (ZEROP Y))))
		 (EQUAL (EQUAL (GCD X Y) 0)
			(AND (ZEROP X) (ZEROP Y)))).

  This simplifies, rewriting with EQUAL-DIFFERENCE-0, and unfolding
  the definitions of ZEROP, AND, GCD, and EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 2.2029948 1.39200847 ]

GCD-EQUAL-0 


(PROVE-LEMMA GCD-0
	     (REWRITE)
	     (EQUAL (GCD 0. Y) (FIX Y)))
This conjecture simplifies, expanding the definitions of EQUAL, GCD,
and FIX, to:

      T.

Q.E.D.


[ 0.0469970703 0.0200113931 ]

GCD-0 


(PROVE-LEMMA COMMUTATIVITY-OF-GCD
	     (REWRITE)
	     (EQUAL (GCD X Y) (GCD Y X)))

     Name the conjecture *1.


     Perhaps we can prove it by induction.  The recursive terms in
the conjecture suggest two inductions.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (ZEROP X) (P X Y))
	   (IMPLIES (AND (NOT (ZEROP X)) (ZEROP Y))
		    (P X Y))
	   (IMPLIES (AND (NOT (ZEROP X))
			 (NOT (ZEROP Y))
			 (LESSP X Y)
			 (P X (DIFFERENCE Y X)))
		    (P X Y))
	   (IMPLIES (AND (NOT (ZEROP X))
			 (NOT (ZEROP Y))
			 ( LEQ Y X)
			 (P (DIFFERENCE X Y) Y))
		    (P X Y))).
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, COUNT-NUMBERP, and
DIFFERENCE-CANCELLATION-0, and the definitions of LEX2 and ZEROP
inform us that the measure (LIST (COUNT X) (COUNT Y)) decreases
according to the well-founded relation LEX2 in each induction step of
the scheme.  The above induction scheme produces four new formulas:

Case 4. (IMPLIES (ZEROP X)
		 (EQUAL (GCD X Y) (GCD Y X))).

  This simplifies, applying the lemma GCD-0, and expanding the
  definitions of ZEROP, EQUAL, NUMBERP, and GCD, to:

        T.

Case 3. (IMPLIES (AND (NOT (ZEROP X)) (ZEROP Y))
		 (EQUAL (GCD X Y) (GCD Y X))),

  which simplifies, rewriting with GCD-0, and opening up ZEROP, EQUAL,
  and GCD, to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP X))
		      (NOT (ZEROP Y))
		      (LESSP X Y)
		      (EQUAL (GCD X (DIFFERENCE Y X))
			     (GCD (DIFFERENCE Y X) X)))
		 (EQUAL (GCD X Y) (GCD Y X))),

  which simplifies, opening up the functions ZEROP and GCD, to:

        (IMPLIES (AND (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (LESSP X Y)
		      (EQUAL (GCD X (DIFFERENCE Y X))
			     (GCD (DIFFERENCE Y X) X))
		      (LESSP Y X))
		 (EQUAL (GCD X (DIFFERENCE Y X))
			(GCD Y (DIFFERENCE X Y)))).

  However this simplifies again, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP X))
		      (NOT (ZEROP Y))
		      ( LEQ Y X)
		      (EQUAL (GCD (DIFFERENCE X Y) Y)
			     (GCD Y (DIFFERENCE X Y))))
		 (EQUAL (GCD X Y) (GCD Y X))),

  which we simplify, unfolding the definitions of ZEROP and GCD, to:

        (IMPLIES (AND (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      ( LEQ Y X)
		      (EQUAL (GCD (DIFFERENCE X Y) Y)
			     (GCD Y (DIFFERENCE X Y)))
		      ( LEQ X Y))
		 (EQUAL (GCD Y (DIFFERENCE X Y))
			(GCD (DIFFERENCE Y X) X))),

  which we again simplify, using linear arithmetic, to the new
  formula:

        (IMPLIES (AND (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL X 0))
		      (NUMBERP X)
		      ( LEQ X X)
		      (EQUAL (GCD (DIFFERENCE X X) X)
			     (GCD X (DIFFERENCE X X)))
		      ( LEQ X X))
		 (EQUAL (GCD X (DIFFERENCE X X))
			(GCD (DIFFERENCE X X) X))).

  This again simplifies, obviously, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.4389974 0.37100423 ]

COMMUTATIVITY-OF-GCD 


(PROVE-LEMMA NTH-APPEND
	     (REWRITE)
	     (EQUAL (NTH (APPEND A B) I)
		    (APPEND (NTH A I)
			    (NTH B (DIFFERENCE I (LENGTH A))))))
.

Appealing to the lemma DIFFERENCE-ELIM, we now replace I by
(PLUS (LENGTH A) X) to eliminate (DIFFERENCE I (LENGTH A)).  We rely
upon the type restriction lemma noted when DIFFERENCE was introduced
to restrict the new variable.  This produces the following three new
goals:

Case 3. (IMPLIES (LESSP I (LENGTH A))
		 (EQUAL (NTH (APPEND A B) I)
			(APPEND (NTH A I)
				(NTH B (DIFFERENCE I (LENGTH A)))))),

  which we simplify, using linear arithmetic, applying DIFFERENCE-0,
  and unfolding the functions EQUAL and NTH, to the new formula:

        (IMPLIES (LESSP I (LENGTH A))
		 (EQUAL (NTH (APPEND A B) I)
			(APPEND (NTH A I) B))),

  which we would usually push and work on later by induction.  But if
  we must use induction to prove the input conjecture, we prefer to
  induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us consider:

(EQUAL (NTH (APPEND A B) I)
       (APPEND (NTH A I)
	       (NTH B (DIFFERENCE I (LENGTH A))))).

We gave this the name *1 above.  We will try to prove it by induction.
Five inductions are suggested by terms in the conjecture.  However,
they merge into one likely candidate induction.  We will induct
according to the following scheme:
      (AND (IMPLIES (ZEROP I) (P A B I))
	   (IMPLIES (AND (NOT (ZEROP I))
			 (P (CDR A) B (SUB1 I)))
		    (P A B I))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP inform us that the measure (COUNT I) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
Note, however, the inductive instance chosen for A.  The above
induction scheme leads to two new goals:

Case 2. (IMPLIES (ZEROP I)
		 (EQUAL (NTH (APPEND A B) I)
			(APPEND (NTH A I)
				(NTH B (DIFFERENCE I (LENGTH A)))))).

  This simplifies, using linear arithmetic, appealing to the lemma
  DIFFERENCE-0, and opening up ZEROP, APPEND, EQUAL, NTH, and LENGTH,
  to:

        T.

Case 1. (IMPLIES
	    (AND (NOT (ZEROP I))
		 (EQUAL (NTH (APPEND (CDR A) B) (SUB1 I))
			(APPEND (NTH (CDR A) (SUB1 I))
				(NTH B
				     (DIFFERENCE (SUB1 I)
						 (LENGTH (CDR A)))))))
	    (EQUAL (NTH (APPEND A B) I)
		   (APPEND (NTH A I)
			   (NTH B (DIFFERENCE I (LENGTH A)))))).

  This simplifies, expanding ZEROP, APPEND, NTH, and LENGTH, to two
  new formulas:

  Case 1.2.
          (IMPLIES
	     (AND (NOT (EQUAL I 0))
		  (NUMBERP I)
		  (EQUAL (NTH (APPEND (CDR A) B) (SUB1 I))
			 (APPEND (NTH (CDR A) (SUB1 I))
				 (NTH B
				      (DIFFERENCE (SUB1 I)
						  (LENGTH (CDR A))))))
		  (NOT (LISTP A)))
	     (EQUAL (NTH B I)
		    (APPEND (NTH (CDR A) (SUB1 I))
			    (NTH B (DIFFERENCE I 0))))),

    which again simplifies, expanding the definitions of EQUAL and
    DIFFERENCE, to the new formula:

          (IMPLIES
	     (AND (NOT (EQUAL I 0))
		  (NUMBERP I)
		  (EQUAL (NTH (APPEND (CDR A) B) (SUB1 I))
			 (APPEND (NTH (CDR A) (SUB1 I))
				 (NTH B
				      (DIFFERENCE (SUB1 I)
						  (LENGTH (CDR A))))))
		  (NOT (LISTP A)))
	     (EQUAL (NTH B I)
		    (APPEND (NTH (CDR A) (SUB1 I))
			    (NTH B I)))).

    This further simplifies, rewriting with CDR-NLISTP and NTH-0, and
    expanding the definitions of LISTP, APPEND, LENGTH, EQUAL, and
    DIFFERENCE, to:

          T.

  Case 1.1.
          (IMPLIES
	   (AND (NOT (EQUAL I 0))
		(NUMBERP I)
		(EQUAL (NTH (APPEND (CDR A) B) (SUB1 I))
		       (APPEND (NTH (CDR A) (SUB1 I))
			       (NTH B
				    (DIFFERENCE (SUB1 I)
						(LENGTH (CDR A))))))
		(LISTP A))
	   (EQUAL
		(NTH (CONS (CAR A) (APPEND (CDR A) B))
		     I)
		(APPEND (NTH (CDR A) (SUB1 I))
			(NTH B
			     (DIFFERENCE I
					 (ADD1 (LENGTH (CDR A)))))))).

    However this again simplifies, rewriting with the lemmas CDR-CONS
    and SUB1-ADD1, and unfolding the definitions of NTH and
    DIFFERENCE, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 3.68599448 0.49100749 ]

NTH-APPEND 


(PROVE-LEMMA DIFFERENCE-PLUS1
	     (REWRITE)
	     (EQUAL (DIFFERENCE (PLUS X Y) X)
		    (FIX Y)))
This simplifies, appealing to the lemma DIFFERENCE-PLUS, and
expanding the function FIX, to:

      T.

Q.E.D.


[ 0.190006511 0.0209960938 ]

DIFFERENCE-PLUS1 


(PROVE-LEMMA DIFFERENCE-PLUS2
	     (REWRITE)
	     (EQUAL (DIFFERENCE (PLUS Y X) X)
		    (FIX Y)))
This simplifies, appealing to the lemmas COMMUTATIVITY-OF-PLUS and
DIFFERENCE-PLUS1, and expanding the function FIX, to:

      T.

Q.E.D.


[ 0.092008463 0.0219970704 ]

DIFFERENCE-PLUS2 


(PROVE-LEMMA DIFFERENCE-PLUS-CANCELATION
	     (REWRITE)
	     (EQUAL (DIFFERENCE (PLUS X Y) (PLUS X Z))
		    (DIFFERENCE Y Z)))
This formula simplifies, using linear arithmetic, to two new formulas:

Case 2. (IMPLIES (LESSP (PLUS X Y) (PLUS X Z))
		 (EQUAL (DIFFERENCE (PLUS X Y) (PLUS X Z))
			(DIFFERENCE Y Z))).

  This simplifies again, using linear arithmetic, applying
  DIFFERENCE-0, and unfolding the function EQUAL, to:

        T.

Case 1. (IMPLIES (LESSP Y Z)
		 (EQUAL (DIFFERENCE (PLUS X Y) (PLUS X Z))
			(DIFFERENCE Y Z))),

  which we again simplify, using linear arithmetic, rewriting with
  DIFFERENCE-0, and unfolding the definition of EQUAL, to:

        T.

Q.E.D.


[ 0.5139974 0.075 ]

DIFFERENCE-PLUS-CANCELATION 


(PROVE-LEMMA TIMES-DIFFERENCE
	     (REWRITE)
	     (EQUAL (TIMES X (DIFFERENCE C W))
		    (DIFFERENCE (TIMES C X) (TIMES W X))))
.

Appealing to the lemma DIFFERENCE-ELIM, we now replace C by
(PLUS W Z) to eliminate (DIFFERENCE C W).  We rely upon the type
restriction lemma noted when DIFFERENCE was introduced to restrict
the new variable.  This produces the following three new goals:

Case 3. (IMPLIES (LESSP C W)
		 (EQUAL (TIMES X (DIFFERENCE C W))
			(DIFFERENCE (TIMES C X)
				    (TIMES W X)))),

  which simplifies, using linear arithmetic, rewriting with
  DIFFERENCE-0, COMMUTATIVITY-OF-TIMES, and EQUAL-DIFFERENCE-0, and
  expanding the functions EQUAL and TIMES, to:

        (IMPLIES (LESSP C W)
		 ( LEQ (TIMES C X) (TIMES W X))),

  which we would normally push and work on later by induction.  But
  if we must use induction to prove the input conjecture, we prefer
  to induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us consider:

(EQUAL (TIMES X (DIFFERENCE C W))
       (DIFFERENCE (TIMES C X) (TIMES W X))),

named *1.  We will try to prove it by induction.  There are five
plausible inductions.  They merge into two likely candidate
inductions.  However, only one is unflawed.  We will induct according
to the following scheme:
      (AND (IMPLIES (ZEROP C) (P X C W))
	   (IMPLIES (AND (NOT (ZEROP C)) (ZEROP W))
		    (P X C W))
	   (IMPLIES (AND (NOT (ZEROP C))
			 (NOT (ZEROP W))
			 (P X (SUB1 C) (SUB1 W)))
		    (P X C W))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP can be used to establish that the measure (COUNT C) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  Note, however, the inductive instance chosen for W.
The above induction scheme produces the following three new goals:

Case 3. (IMPLIES (ZEROP C)
		 (EQUAL (TIMES X (DIFFERENCE C W))
			(DIFFERENCE (TIMES C X)
				    (TIMES W X)))),

  which simplifies, using linear arithmetic, rewriting with
  DIFFERENCE-0 and COMMUTATIVITY-OF-TIMES, and expanding ZEROP, EQUAL,
  and TIMES, to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP C)) (ZEROP W))
		 (EQUAL (TIMES X (DIFFERENCE C W))
			(DIFFERENCE (TIMES C X)
				    (TIMES W X)))),

  which we simplify, applying COMMUTATIVITY-OF-TIMES, PLUS-EQUAL-0,
  and EQUAL-TIMES-0, and expanding the definitions of ZEROP, EQUAL,
  DIFFERENCE, and TIMES, to four new goals:

  Case 2.4.
          (IMPLIES (AND (NOT (EQUAL C 0))
			(NUMBERP C)
			(EQUAL W 0)
			(NOT (NUMBERP X)))
		   (EQUAL (PLUS X (TIMES (SUB1 C) X))
			  0)),

    which we again simplify, rewriting with EQUAL-TIMES-0, and
    expanding the definition of PLUS, to:

          T.

  Case 2.3.
          (IMPLIES (AND (NOT (EQUAL C 0))
			(NUMBERP C)
			(EQUAL W 0)
			(EQUAL X 0))
		   (EQUAL (PLUS X (TIMES (SUB1 C) X))
			  0)),

    which we again simplify, applying COMMUTATIVITY-OF-TIMES, and
    opening up EQUAL, TIMES, and PLUS, to:

          T.

  Case 2.2.
          (IMPLIES (AND (NOT (EQUAL C 0))
			(NUMBERP C)
			(NOT (NUMBERP W))
			(NOT (NUMBERP X)))
		   (EQUAL (PLUS X (TIMES (SUB1 C) X))
			  0)).

    But this simplifies again, rewriting with EQUAL-TIMES-0, and
    expanding the function PLUS, to:

          T.

  Case 2.1.
          (IMPLIES (AND (NOT (EQUAL C 0))
			(NUMBERP C)
			(NOT (NUMBERP W))
			(EQUAL X 0))
		   (EQUAL (PLUS X (TIMES (SUB1 C) X))
			  0)).

    However this simplifies again, rewriting with the lemma
    COMMUTATIVITY-OF-TIMES, and expanding the definitions of EQUAL,
    TIMES, and PLUS, to:

          T.

Case 1. (IMPLIES (AND (NOT (ZEROP C))
		      (NOT (ZEROP W))
		      (EQUAL (TIMES X
				    (DIFFERENCE (SUB1 C) (SUB1 W)))
			     (DIFFERENCE (TIMES (SUB1 C) X)
					 (TIMES (SUB1 W) X))))
		 (EQUAL (TIMES X (DIFFERENCE C W))
			(DIFFERENCE (TIMES C X)
				    (TIMES W X)))).

  This simplifies, applying DIFFERENCE-PLUS-CANCELATION, and
  expanding the functions ZEROP, DIFFERENCE, and TIMES, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 7.4900065 0.51499023 ]

TIMES-DIFFERENCE 


(DEFN DIVIDES
      (X Y)
      (ZEROP (REMAINDER Y X)))
     Note that (OR (FALSEP (DIVIDES X Y)) (TRUEP (DIVIDES X Y))) is a
theorem.




[ 0.0279947917 0.0120035807 ]

DIVIDES 


(PROVE-LEMMA DIVIDES-TIMES
	     (REWRITE)
	     (EQUAL (REMAINDER (TIMES X Z) Z) 0.))

     Name the conjecture *1.


     Perhaps we can prove it by induction.  There is only one
plausible induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (ZEROP X) (P X Z))
	   (IMPLIES (AND (NOT (ZEROP X)) (P (SUB1 X) Z))
		    (P X Z))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP inform us that the measure (COUNT X) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme produces two new formulas:

Case 2. (IMPLIES (ZEROP X)
		 (EQUAL (REMAINDER (TIMES X Z) Z) 0)).

  This simplifies, opening up the definitions of ZEROP, EQUAL, TIMES,
  LESSP, NUMBERP, and REMAINDER, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP X))
		      (EQUAL (REMAINDER (TIMES (SUB1 X) Z) Z)
			     0))
		 (EQUAL (REMAINDER (TIMES X Z) Z) 0)),

  which we simplify, rewriting with the lemma DIFFERENCE-PLUS1, and
  unfolding the functions ZEROP, TIMES, and REMAINDER, to the
  following three new formulas:

  Case 1.3.
          (IMPLIES (AND (NOT (EQUAL X 0))
			(NUMBERP X)
			(EQUAL (REMAINDER (TIMES (SUB1 X) Z) Z)
			       0)
			(NOT (NUMBERP Z)))
		   (EQUAL (PLUS Z (TIMES (SUB1 X) Z))
			  0)).

    But this again simplifies, rewriting with REMAINDER-WRT-12 and
    EQUAL-TIMES-0, and expanding PLUS, to:

          T.

  Case 1.2.
          (IMPLIES (AND (NOT (EQUAL X 0))
			(NUMBERP X)
			(EQUAL (REMAINDER (TIMES (SUB1 X) Z) Z)
			       0)
			(EQUAL Z 0))
		   (EQUAL (PLUS Z (TIMES (SUB1 X) Z))
			  0)),

    which we again simplify, rewriting with the lemma
    COMMUTATIVITY-OF-TIMES, and expanding the definitions of EQUAL,
    TIMES, REMAINDER, and PLUS, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NOT (EQUAL X 0))
			(NUMBERP X)
			(EQUAL (REMAINDER (TIMES (SUB1 X) Z) Z)
			       0)
			(LESSP (PLUS Z (TIMES (SUB1 X) Z)) Z))
		   (EQUAL (PLUS Z (TIMES (SUB1 X) Z))
			  0)),

    which we again simplify, using linear arithmetic, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 1.55401205 0.26398926 ]

DIVIDES-TIMES 


(PROVE-LEMMA DIFFERENCE-PLUS3
	     (REWRITE)
	     (EQUAL (DIFFERENCE (PLUS B (PLUS A C)) A)
		    (PLUS B C)))
This formula simplifies, using linear arithmetic, to:

      (IMPLIES (LESSP (PLUS B (PLUS A C)) A)
	       (EQUAL (DIFFERENCE (PLUS B (PLUS A C)) A)
		      (PLUS B C))).

But this simplifies again, using linear arithmetic, to:

      T.

Q.E.D.


[ 0.067000326 0.0360026043 ]

DIFFERENCE-PLUS3 


(PROVE-LEMMA DIFFERENCE-ADD1-CANCELLATION
	     (REWRITE)
	     (EQUAL (DIFFERENCE (ADD1 (PLUS Y Z)) Z)
		    (ADD1 Y)))
This formula simplifies, using linear arithmetic, to:

      (IMPLIES (LESSP (ADD1 (PLUS Y Z)) Z)
	       (EQUAL (DIFFERENCE (ADD1 (PLUS Y Z)) Z)
		      (ADD1 Y))).

However this again simplifies, using linear arithmetic, to:

      T.

Q.E.D.


[ 0.0559895835 0.037011719 ]

DIFFERENCE-ADD1-CANCELLATION 


(PROVE-LEMMA REMAINDER-ADD1
	     (REWRITE)
	     (IMPLIES (AND (NOT (ZEROP Y))
			   (NOT (EQUAL Y 1.)))
		      (NOT (EQUAL (REMAINDER (ADD1 (TIMES X Y)) Y)
				  0.))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT,
AND, and IMPLIES, to the new conjecture:

      (IMPLIES (AND (NOT (EQUAL Y 0))
		    (NUMBERP Y)
		    (NOT (EQUAL Y 1)))
	       (NOT (EQUAL (REMAINDER (ADD1 (TIMES X Y)) Y)
			   0))).

Call the above conjecture *1.


     We will appeal to induction.  There is only one plausible
induction.  We will induct according to the following scheme:
      (AND (IMPLIES (ZEROP X) (P X Y))
	   (IMPLIES (AND (NOT (ZEROP X)) (P (SUB1 X) Y))
		    (P X Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP establish that the measure (COUNT X) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme leads to the following two new conjectures:

Case 2. (IMPLIES (AND (ZEROP X)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1)))
		 (NOT (EQUAL (REMAINDER (ADD1 (TIMES X Y)) Y)
			     0))).

  This simplifies, using linear arithmetic, applying DIFFERENCE-0,
  and expanding the functions ZEROP, EQUAL, TIMES, ADD1, NUMBERP,
  REMAINDER, and LESSP, to the following two new formulas:

  Case 2.2.
          (IMPLIES (AND (EQUAL X 0)
			(NOT (EQUAL Y 0))
			(NUMBERP Y)
			(NOT (EQUAL Y 1)))
		   (LESSP 1 Y)),

    which again simplifies, using linear arithmetic, to:

          T.

  Case 2.1.
          (IMPLIES (AND (NOT (NUMBERP X))
			(NOT (EQUAL Y 0))
			(NUMBERP Y)
			(NOT (EQUAL Y 1)))
		   (LESSP 1 Y)),

    which again simplifies, using linear arithmetic, to:

          T.

Case 1. (IMPLIES (AND (NOT (ZEROP X))
		      (NOT (EQUAL (REMAINDER (ADD1 (TIMES (SUB1 X) Y))
					     Y)
				  0))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1)))
		 (NOT (EQUAL (REMAINDER (ADD1 (TIMES X Y)) Y)
			     0))).

  This simplifies, unfolding the definitions of ZEROP and TIMES, to:

        (IMPLIES
	     (AND (NOT (EQUAL X 0))
		  (NUMBERP X)
		  (NOT (EQUAL (REMAINDER (ADD1 (TIMES (SUB1 X) Y))
					 Y)
			      0))
		  (NOT (EQUAL Y 0))
		  (NUMBERP Y)
		  (NOT (EQUAL Y 1)))
	     (NOT (EQUAL (REMAINDER (ADD1 (PLUS Y (TIMES (SUB1 X) Y)))
				    Y)
			 0))),

  which we further simplify, rewriting with the lemma
  COMMUTATIVITY-OF-TIMES, to:

        (IMPLIES
	     (AND (NOT (EQUAL X 0))
		  (NUMBERP X)
		  (NOT (EQUAL (REMAINDER (ADD1 (TIMES Y (SUB1 X)))
					 Y)
			      0))
		  (NOT (EQUAL Y 0))
		  (NUMBERP Y)
		  (NOT (EQUAL Y 1)))
	     (NOT (EQUAL (REMAINDER (ADD1 (PLUS Y (TIMES Y (SUB1 X))))
				    Y)
			 0))).

  Appealing to the lemma SUB1-ELIM, we now replace X by (ADD1 Z) to
  eliminate (SUB1 X).  We rely upon the type restriction lemma noted
  when SUB1 was introduced to constrain the new variable.  This
  produces:

        (IMPLIES (AND (NUMBERP Z)
		      (NOT (EQUAL (ADD1 Z) 0))
		      (NOT (EQUAL (REMAINDER (ADD1 (TIMES Y Z)) Y)
				  0))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1)))
		 (NOT (EQUAL (REMAINDER (ADD1 (PLUS Y (TIMES Y Z)))
					Y)
			     0))).

  This further simplifies, obviously, to:

        (IMPLIES (AND (NUMBERP Z)
		      (NOT (EQUAL (REMAINDER (ADD1 (TIMES Y Z)) Y)
				  0))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1)))
		 (NOT (EQUAL (REMAINDER (ADD1 (PLUS Y (TIMES Y Z)))
					Y)
			     0))).

  We will try to prove the above conjecture by generalizing it,
  replacing (TIMES Y Z) by A.  We restrict the new variable by
  appealing to the type restriction lemma noted when TIMES was
  introduced.  The result is the new formula:

        (IMPLIES (AND (NUMBERP A)
		      (NUMBERP Z)
		      (NOT (EQUAL (REMAINDER (ADD1 A) Y) 0))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1)))
		 (NOT (EQUAL (REMAINDER (ADD1 (PLUS Y A)) Y)
			     0))),

  which we further simplify, applying COMMUTATIVITY-OF-PLUS,
  DIFFERENCE-ADD1-CANCELLATION, and SUB1-ADD1, and unfolding LESSP
  and REMAINDER, to the conjecture:

        (IMPLIES (AND (NUMBERP A)
		      (NUMBERP Z)
		      (NOT (EQUAL (REMAINDER (ADD1 A) Y) 0))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1))
		      (LESSP (PLUS A Y) (SUB1 Y)))
		 (NOT (EQUAL (ADD1 (PLUS A Y)) 0))),

  which finally simplifies, using linear arithmetic, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 20.8930175 0.5149821 ]

REMAINDER-ADD1 


(PROVE-LEMMA DIVIDES-PLUS-REWRITE1
	     (REWRITE)
	     (IMPLIES (AND (EQUAL (REMAINDER X Z) 0.)
			   (EQUAL (REMAINDER Y Z) 0.))
		      (EQUAL (REMAINDER (PLUS X Y) Z) 0.)))
.

Applying the lemma REMAINDER-QUOTIENT-ELIM, replace X by
(PLUS V (TIMES Z W)) to eliminate (REMAINDER X Z) and (QUOTIENT X Z).
We use LESSP-REMAINDER2, the type restriction lemma noted when
REMAINDER was introduced, and the type restriction lemma noted when
QUOTIENT was introduced to constrain the new variables.  We would
thus like to prove the following four new formulas:

Case 4. (IMPLIES (AND (NOT (NUMBERP X))
		      (EQUAL (REMAINDER X Z) 0)
		      (EQUAL (REMAINDER Y Z) 0))
		 (EQUAL (REMAINDER (PLUS X Y) Z) 0)).

  But this simplifies, unfolding LESSP, REMAINDER, EQUAL, and PLUS,
  to:

        (IMPLIES (AND (NOT (NUMBERP X))
		      (EQUAL (REMAINDER Y Z) 0)
		      (NOT (NUMBERP Y)))
		 (EQUAL (REMAINDER 0 Z) 0)).

  This simplifies again, expanding the functions LESSP, REMAINDER,
  EQUAL, and NUMBERP, to:

        T.

Case 3. (IMPLIES (AND (EQUAL Z 0)
		      (EQUAL (REMAINDER X Z) 0)
		      (EQUAL (REMAINDER Y Z) 0))
		 (EQUAL (REMAINDER (PLUS X Y) Z) 0)).

  However this simplifies, rewriting with PLUS-RIGHT-ID2 and
  COMMUTATIVITY-OF-PLUS, and unfolding the functions EQUAL, REMAINDER,
  PLUS, and NUMBERP, to:

        T.

Case 2. (IMPLIES (AND (NOT (NUMBERP Z))
		      (EQUAL (REMAINDER X Z) 0)
		      (EQUAL (REMAINDER Y Z) 0))
		 (EQUAL (REMAINDER (PLUS X Y) Z) 0)).

  But this simplifies, applying REMAINDER-WRT-12, PLUS-RIGHT-ID2, and
  COMMUTATIVITY-OF-PLUS, and unfolding the definitions of PLUS,
  NUMBERP, and EQUAL, to:

        T.

Case 1. (IMPLIES (AND (NUMBERP V)
		      (EQUAL (LESSP V Z) (NOT (ZEROP Z)))
		      (NUMBERP W)
		      (NUMBERP Z)
		      (NOT (EQUAL Z 0))
		      (EQUAL V 0)
		      (EQUAL (REMAINDER Y Z) 0))
		 (EQUAL (REMAINDER (PLUS (PLUS V (TIMES Z W)) Y)
				   Z)
			0)),

  which we simplify, rewriting with COMMUTATIVITY-OF-TIMES and
  COMMUTATIVITY-OF-PLUS, and expanding the definitions of NUMBERP,
  EQUAL, LESSP, ZEROP, NOT, and PLUS, to:

        (IMPLIES (AND (NUMBERP W)
		      (NUMBERP Z)
		      (NOT (EQUAL Z 0))
		      (EQUAL (REMAINDER Y Z) 0))
		 (EQUAL (REMAINDER (PLUS Y (TIMES W Z)) Z)
			0)).

  Applying the lemma REMAINDER-QUOTIENT-ELIM, we now replace Y by
  (PLUS V (TIMES Z D)) to eliminate (REMAINDER Y Z) and
  (QUOTIENT Y Z).  We employ LESSP-REMAINDER2, the type restriction
  lemma noted when REMAINDER was introduced, and the type restriction
  lemma noted when QUOTIENT was introduced to constrain the new
  variables.  We must thus prove two new conjectures:

  Case 1.2.
          (IMPLIES (AND (NOT (NUMBERP Y))
			(NUMBERP W)
			(NUMBERP Z)
			(NOT (EQUAL Z 0))
			(EQUAL (REMAINDER Y Z) 0))
		   (EQUAL (REMAINDER (PLUS Y (TIMES W Z)) Z)
			  0)),

    which we further simplify, applying DIVIDES-TIMES, and opening up
    LESSP, REMAINDER, EQUAL, and PLUS, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NUMBERP V)
			(EQUAL (LESSP V Z) (NOT (ZEROP Z)))
			(NUMBERP D)
			(NUMBERP W)
			(NUMBERP Z)
			(NOT (EQUAL Z 0))
			(EQUAL V 0))
		   (EQUAL (REMAINDER (PLUS (PLUS V (TIMES Z D))
					   (TIMES W Z))
				     Z)
			  0)).

    But this simplifies further, rewriting with
    COMMUTATIVITY-OF-TIMES, and expanding the functions NUMBERP,
    EQUAL, LESSP, ZEROP, NOT, and PLUS, to:

          (IMPLIES (AND (NUMBERP D)
			(NUMBERP W)
			(NUMBERP Z)
			(NOT (EQUAL Z 0)))
		   (EQUAL (REMAINDER (PLUS (TIMES D Z) (TIMES W Z))
				     Z)
			  0)),

    which we would normally push and work on later by induction.  But
    if we must use induction to prove the input conjecture, we prefer
    to induct on the original formulation of the problem.  Thus we
    will disregard all that we have previously done, give the name *1
    to the original input, and work on it.


     So now let us consider:

(IMPLIES (AND (EQUAL (REMAINDER X Z) 0)
	      (EQUAL (REMAINDER Y Z) 0))
	 (EQUAL (REMAINDER (PLUS X Y) Z) 0)),

named *1.  We will try to prove it by induction.  Three inductions
are suggested by terms in the conjecture, two of which are unflawed.
So we will choose the one suggested by the largest number of
nonprimitive recursive functions.  We will induct according to the
following scheme:
      (AND (IMPLIES (ZEROP Z) (P X Y Z))
	   (IMPLIES (AND (NOT (ZEROP Z)) (LESSP X Z))
		    (P X Y Z))
	   (IMPLIES (AND (NOT (ZEROP Z))
			 ( LEQ Z X)
			 (P (DIFFERENCE X Z) Y Z))
		    (P X Y Z))).
Linear arithmetic, the lemmas COUNT-NUMBERP and COUNT-NOT-LESSP, and
the definition of ZEROP inform us that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each
induction step of the scheme.  The above induction scheme leads to
the following four new conjectures:

Case 4. (IMPLIES (AND (ZEROP Z)
		      (EQUAL (REMAINDER X Z) 0)
		      (EQUAL (REMAINDER Y Z) 0))
		 (EQUAL (REMAINDER (PLUS X Y) Z) 0)).

  This simplifies, appealing to the lemmas PLUS-RIGHT-ID2,
  COMMUTATIVITY-OF-PLUS, and REMAINDER-WRT-12, and unfolding the
  definitions of ZEROP, EQUAL, REMAINDER, PLUS, and NUMBERP, to:

        T.

Case 3. (IMPLIES (AND (NOT (ZEROP Z))
		      (LESSP X Z)
		      (EQUAL (REMAINDER X Z) 0)
		      (EQUAL (REMAINDER Y Z) 0))
		 (EQUAL (REMAINDER (PLUS X Y) Z) 0)),

  which simplifies, expanding the functions ZEROP, REMAINDER, EQUAL,
  and PLUS, to two new conjectures:

  Case 3.2.
          (IMPLIES (AND (NOT (EQUAL Z 0))
			(NUMBERP Z)
			(LESSP X Z)
			(EQUAL X 0)
			(EQUAL (REMAINDER Y Z) 0)
			(NOT (NUMBERP Y)))
		   (EQUAL (REMAINDER 0 Z) 0)),

    which we again simplify, opening up the functions EQUAL, LESSP,
    REMAINDER, and NUMBERP, to:

          T.

  Case 3.1.
          (IMPLIES (AND (NOT (EQUAL Z 0))
			(NUMBERP Z)
			(LESSP X Z)
			(NOT (NUMBERP X))
			(EQUAL (REMAINDER Y Z) 0)
			(NOT (NUMBERP Y)))
		   (EQUAL (REMAINDER 0 Z) 0)),

    which we again simplify, expanding the definitions of LESSP,
    REMAINDER, EQUAL, and NUMBERP, to:

          T.

Case 2. (IMPLIES (AND (NOT (ZEROP Z))
		      ( LEQ Z X)
		      (NOT (EQUAL (REMAINDER (DIFFERENCE X Z) Z)
				  0))
		      (EQUAL (REMAINDER X Z) 0)
		      (EQUAL (REMAINDER Y Z) 0))
		 (EQUAL (REMAINDER (PLUS X Y) Z) 0)),

  which we simplify, opening up ZEROP and REMAINDER, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP Z))
		      ( LEQ Z X)
		      (EQUAL (REMAINDER (PLUS (DIFFERENCE X Z) Y)
					Z)
			     0)
		      (EQUAL (REMAINDER X Z) 0)
		      (EQUAL (REMAINDER Y Z) 0))
		 (EQUAL (REMAINDER (PLUS X Y) Z) 0)).

  This simplifies, applying the lemma COMMUTATIVITY-OF-PLUS, and
  opening up ZEROP and REMAINDER, to:

        (IMPLIES (AND (NOT (EQUAL Z 0))
		      (NUMBERP Z)
		      ( LEQ Z X)
		      (EQUAL (REMAINDER (PLUS Y (DIFFERENCE X Z))
					Z)
			     0)
		      (EQUAL (REMAINDER (DIFFERENCE X Z) Z)
			     0)
		      (EQUAL (REMAINDER Y Z) 0))
		 (EQUAL (REMAINDER (PLUS X Y) Z) 0)).

  Appealing to the lemmas DIFFERENCE-ELIM and REMAINDER-QUOTIENT-ELIM,
  replace X by (PLUS Z V) to eliminate (DIFFERENCE X Z) and V by
  (PLUS W (TIMES Z D)) to eliminate (REMAINDER V Z) and
  (QUOTIENT V Z).  We rely upon the type restriction lemma noted when
  DIFFERENCE was introduced, LESSP-REMAINDER2, the type restriction
  lemma noted when REMAINDER was introduced, and the type restriction
  lemma noted when QUOTIENT was introduced to restrict the new
  variables.  We thus obtain the following two new conjectures:

  Case 1.2.
          (IMPLIES (AND (NOT (NUMBERP X))
			(NOT (EQUAL Z 0))
			(NUMBERP Z)
			( LEQ Z X)
			(EQUAL (REMAINDER (PLUS Y (DIFFERENCE X Z))
					  Z)
			       0)
			(EQUAL (REMAINDER (DIFFERENCE X Z) Z)
			       0)
			(EQUAL (REMAINDER Y Z) 0))
		   (EQUAL (REMAINDER (PLUS X Y) Z) 0)).

    This simplifies further, opening up the definition of LESSP, to:

          T.

  Case 1.1.
          (IMPLIES
	      (AND (NUMBERP W)
		   (EQUAL (LESSP W Z) (NOT (ZEROP Z)))
		   (NUMBERP D)
		   (NOT (EQUAL Z 0))
		   (NUMBERP Z)
		   ( LEQ Z (PLUS Z (PLUS W (TIMES Z D))))
		   (EQUAL (REMAINDER (PLUS Y (PLUS W (TIMES Z D)))
				     Z)
			  0)
		   (EQUAL W 0)
		   (EQUAL (REMAINDER Y Z) 0))
	      (EQUAL (REMAINDER (PLUS (PLUS Z (PLUS W (TIMES Z D))) Y)
				Z)
		     0)).

    But this simplifies further, rewriting with the lemmas
    COMMUTATIVITY-OF-TIMES, COMMUTATIVITY-OF-PLUS,
    COMMUTATIVITY2-OF-PLUS, ASSOCIATIVITY-OF-PLUS, and
    DIFFERENCE-PLUS3, and expanding the definitions of NUMBERP, EQUAL,
    LESSP, ZEROP, NOT, PLUS, and REMAINDER, to:

          (IMPLIES (AND (NUMBERP D)
			(NOT (EQUAL Z 0))
			(NUMBERP Z)
			( LEQ Z (PLUS Z (TIMES D Z)))
			(EQUAL (REMAINDER (PLUS Y (TIMES D Z)) Z)
			       0)
			(EQUAL (REMAINDER Y Z) 0)
			(LESSP (PLUS Y (PLUS Z (TIMES D Z)))
			       Z))
		   (EQUAL (PLUS Y (PLUS Z (TIMES D Z)))
			  0)).

    This simplifies again, using linear arithmetic, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 20.0909913 1.04001465 ]

DIVIDES-PLUS-REWRITE1 


(PROVE-LEMMA DIVIDES-PLUS-REWRITE2
	     (REWRITE)
	     (IMPLIES (AND (EQUAL (REMAINDER X Z) 0.)
			   (NOT (EQUAL (REMAINDER Y Z) 0.)))
		      (NOT (EQUAL (REMAINDER (PLUS X Y) Z) 0.))))
.

Applying the lemma REMAINDER-QUOTIENT-ELIM, replace X by
(PLUS V (TIMES Z W)) to eliminate (REMAINDER X Z) and (QUOTIENT X Z).
We employ LESSP-REMAINDER2, the type restriction lemma noted when
REMAINDER was introduced, and the type restriction lemma noted when
QUOTIENT was introduced to restrict the new variables.  We thus
obtain four new formulas:

Case 4. (IMPLIES (AND (NOT (NUMBERP X))
		      (EQUAL (REMAINDER X Z) 0)
		      (NOT (EQUAL (REMAINDER Y Z) 0)))
		 (NOT (EQUAL (REMAINDER (PLUS X Y) Z) 0))).

  This simplifies, expanding the definitions of LESSP, REMAINDER,
  EQUAL, and PLUS, to:

        (IMPLIES (AND (NOT (NUMBERP X))
		      (NOT (EQUAL (REMAINDER Y Z) 0))
		      (NOT (NUMBERP Y)))
		 (NOT (EQUAL (REMAINDER 0 Z) 0))),

  which again simplifies, unfolding the functions LESSP, REMAINDER,
  and EQUAL, to:

        T.

Case 3. (IMPLIES (AND (EQUAL Z 0)
		      (EQUAL (REMAINDER X Z) 0)
		      (NOT (EQUAL (REMAINDER Y Z) 0)))
		 (NOT (EQUAL (REMAINDER (PLUS X Y) Z) 0))).

  However this simplifies, opening up the functions EQUAL, REMAINDER,
  and PLUS, to:

        T.

Case 2. (IMPLIES (AND (NOT (NUMBERP Z))
		      (EQUAL (REMAINDER X Z) 0)
		      (NOT (EQUAL (REMAINDER Y Z) 0)))
		 (NOT (EQUAL (REMAINDER (PLUS X Y) Z) 0))),

  which simplifies, rewriting with REMAINDER-WRT-12, and expanding
  EQUAL and PLUS, to:

        T.

Case 1. (IMPLIES (AND (NUMBERP V)
		      (EQUAL (LESSP V Z) (NOT (ZEROP Z)))
		      (NUMBERP W)
		      (NUMBERP Z)
		      (NOT (EQUAL Z 0))
		      (EQUAL V 0)
		      (NOT (EQUAL (REMAINDER Y Z) 0)))
		 (NOT (EQUAL (REMAINDER (PLUS (PLUS V (TIMES Z W)) Y)
					Z)
			     0))),

  which we simplify, applying COMMUTATIVITY-OF-TIMES and
  COMMUTATIVITY-OF-PLUS, and expanding the definitions of NUMBERP,
  EQUAL, LESSP, ZEROP, NOT, and PLUS, to:

        (IMPLIES (AND (NUMBERP W)
		      (NUMBERP Z)
		      (NOT (EQUAL Z 0))
		      (NOT (EQUAL (REMAINDER Y Z) 0)))
		 (NOT (EQUAL (REMAINDER (PLUS Y (TIMES W Z)) Z)
			     0))).

  Applying the lemma REMAINDER-QUOTIENT-ELIM, we now replace Y by
  (PLUS V (TIMES Z D)) to eliminate (REMAINDER Y Z) and
  (QUOTIENT Y Z).  We employ LESSP-REMAINDER2, the type restriction
  lemma noted when REMAINDER was introduced, and the type restriction
  lemma noted when QUOTIENT was introduced to restrict the new
  variables.  We would thus like to prove the following two new
  formulas:

  Case 1.2.
          (IMPLIES (AND (NOT (NUMBERP Y))
			(NUMBERP W)
			(NUMBERP Z)
			(NOT (EQUAL Z 0))
			(NOT (EQUAL (REMAINDER Y Z) 0)))
		   (NOT (EQUAL (REMAINDER (PLUS Y (TIMES W Z)) Z)
			       0))),

    which further simplifies, opening up LESSP, REMAINDER, and EQUAL,
    to:

          T.

  Case 1.1.
          (IMPLIES (AND (NUMBERP V)
			(EQUAL (LESSP V Z) (NOT (ZEROP Z)))
			(NUMBERP D)
			(NUMBERP W)
			(NUMBERP Z)
			(NOT (EQUAL Z 0))
			(NOT (EQUAL V 0)))
		   (NOT (EQUAL (REMAINDER (PLUS (PLUS V (TIMES Z D))
						(TIMES W Z))
					  Z)
			       0))).

    But this simplifies further, rewriting with
    COMMUTATIVITY-OF-TIMES and ASSOCIATIVITY-OF-PLUS, and expanding
    the functions ZEROP and NOT, to:

          (IMPLIES
	   (AND (NUMBERP V)
		(LESSP V Z)
		(NUMBERP D)
		(NUMBERP W)
		(NUMBERP Z)
		(NOT (EQUAL Z 0))
		(NOT (EQUAL V 0)))
	   (NOT
	       (EQUAL (REMAINDER (PLUS V
				       (PLUS (TIMES D Z) (TIMES W Z)))
				 Z)
		      0))),

    which we would normally push and work on later by induction.  But
    if we must use induction to prove the input conjecture, we prefer
    to induct on the original formulation of the problem.  Thus we
    will disregard all that we have previously done, give the name *1
    to the original input, and work on it.


     So now let us consider:

(IMPLIES (AND (EQUAL (REMAINDER X Z) 0)
	      (NOT (EQUAL (REMAINDER Y Z) 0)))
	 (NOT (EQUAL (REMAINDER (PLUS X Y) Z) 0))),

named *1.  We will try to prove it by induction.  Three inductions
are suggested by terms in the conjecture, two of which are unflawed.
So we will choose the one suggested by the largest number of
nonprimitive recursive functions.  We will induct according to the
following scheme:
      (AND (IMPLIES (ZEROP Z) (P X Y Z))
	   (IMPLIES (AND (NOT (ZEROP Z)) (LESSP X Z))
		    (P X Y Z))
	   (IMPLIES (AND (NOT (ZEROP Z))
			 ( LEQ Z X)
			 (P (DIFFERENCE X Z) Y Z))
		    (P X Y Z))).
Linear arithmetic, the lemmas COUNT-NUMBERP and COUNT-NOT-LESSP, and
the definition of ZEROP inform us that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each
induction step of the scheme.  The above induction scheme leads to
the following four new conjectures:

Case 4. (IMPLIES (AND (ZEROP Z)
		      (EQUAL (REMAINDER X Z) 0)
		      (NOT (EQUAL (REMAINDER Y Z) 0)))
		 (NOT (EQUAL (REMAINDER (PLUS X Y) Z) 0))).

  This simplifies, appealing to the lemma REMAINDER-WRT-12, and
  unfolding the definitions of ZEROP, EQUAL, REMAINDER, and PLUS, to:

        T.

Case 3. (IMPLIES (AND (NOT (ZEROP Z))
		      (LESSP X Z)
		      (EQUAL (REMAINDER X Z) 0)
		      (NOT (EQUAL (REMAINDER Y Z) 0)))
		 (NOT (EQUAL (REMAINDER (PLUS X Y) Z) 0))),

  which simplifies, expanding the functions ZEROP, REMAINDER, EQUAL,
  and PLUS, to two new conjectures:

  Case 3.2.
          (IMPLIES (AND (NOT (EQUAL Z 0))
			(NUMBERP Z)
			(LESSP X Z)
			(EQUAL X 0)
			(NOT (EQUAL (REMAINDER Y Z) 0))
			(NOT (NUMBERP Y)))
		   (NOT (EQUAL (REMAINDER 0 Z) 0))),

    which we again simplify, opening up the functions EQUAL, LESSP,
    and REMAINDER, to:

          T.

  Case 3.1.
          (IMPLIES (AND (NOT (EQUAL Z 0))
			(NUMBERP Z)
			(LESSP X Z)
			(NOT (NUMBERP X))
			(NOT (EQUAL (REMAINDER Y Z) 0))
			(NOT (NUMBERP Y)))
		   (NOT (EQUAL (REMAINDER 0 Z) 0))),

    which we again simplify, expanding the definitions of LESSP,
    REMAINDER, and EQUAL, to:

          T.

Case 2. (IMPLIES (AND (NOT (ZEROP Z))
		      ( LEQ Z X)
		      (NOT (EQUAL (REMAINDER (DIFFERENCE X Z) Z)
				  0))
		      (EQUAL (REMAINDER X Z) 0)
		      (NOT (EQUAL (REMAINDER Y Z) 0)))
		 (NOT (EQUAL (REMAINDER (PLUS X Y) Z) 0))),

  which we simplify, opening up ZEROP and REMAINDER, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP Z))
		      ( LEQ Z X)
		      (NOT (EQUAL (REMAINDER (PLUS (DIFFERENCE X Z) Y)
					     Z)
				  0))
		      (EQUAL (REMAINDER X Z) 0)
		      (NOT (EQUAL (REMAINDER Y Z) 0)))
		 (NOT (EQUAL (REMAINDER (PLUS X Y) Z) 0))).

  This simplifies, applying the lemma COMMUTATIVITY-OF-PLUS, and
  opening up ZEROP and REMAINDER, to:

        (IMPLIES (AND (NOT (EQUAL Z 0))
		      (NUMBERP Z)
		      ( LEQ Z X)
		      (NOT (EQUAL (REMAINDER (PLUS Y (DIFFERENCE X Z))
					     Z)
				  0))
		      (EQUAL (REMAINDER (DIFFERENCE X Z) Z)
			     0)
		      (NOT (EQUAL (REMAINDER Y Z) 0)))
		 (NOT (EQUAL (REMAINDER (PLUS X Y) Z) 0))).

  Appealing to the lemmas DIFFERENCE-ELIM and REMAINDER-QUOTIENT-ELIM,
  replace X by (PLUS Z V) to eliminate (DIFFERENCE X Z) and V by
  (PLUS W (TIMES Z D)) to eliminate (REMAINDER V Z) and
  (QUOTIENT V Z).  We rely upon the type restriction lemma noted when
  DIFFERENCE was introduced, LESSP-REMAINDER2, the type restriction
  lemma noted when REMAINDER was introduced, and the type restriction
  lemma noted when QUOTIENT was introduced to restrict the new
  variables.  We thus obtain the following two new conjectures:

  Case 1.2.
          (IMPLIES
		 (AND (NOT (NUMBERP X))
		      (NOT (EQUAL Z 0))
		      (NUMBERP Z)
		      ( LEQ Z X)
		      (NOT (EQUAL (REMAINDER (PLUS Y (DIFFERENCE X Z))
					     Z)
				  0))
		      (EQUAL (REMAINDER (DIFFERENCE X Z) Z)
			     0)
		      (NOT (EQUAL (REMAINDER Y Z) 0)))
		 (NOT (EQUAL (REMAINDER (PLUS X Y) Z) 0))).

    This simplifies further, opening up the definition of LESSP, to:

          T.

  Case 1.1.
          (IMPLIES
	   (AND (NUMBERP W)
		(EQUAL (LESSP W Z) (NOT (ZEROP Z)))
		(NUMBERP D)
		(NOT (EQUAL Z 0))
		(NUMBERP Z)
		( LEQ Z (PLUS Z (PLUS W (TIMES Z D))))
		(NOT (EQUAL (REMAINDER (PLUS Y (PLUS W (TIMES Z D)))
				       Z)
			    0))
		(EQUAL W 0)
		(NOT (EQUAL (REMAINDER Y Z) 0)))
	   (NOT
	      (EQUAL (REMAINDER (PLUS (PLUS Z (PLUS W (TIMES Z D))) Y)
				Z)
		     0))).

    But this simplifies further, rewriting with the lemmas
    COMMUTATIVITY-OF-TIMES, COMMUTATIVITY-OF-PLUS,
    COMMUTATIVITY2-OF-PLUS, ASSOCIATIVITY-OF-PLUS, and
    DIFFERENCE-PLUS3, and expanding the definitions of NUMBERP, EQUAL,
    LESSP, ZEROP, NOT, PLUS, and REMAINDER, to:

          (IMPLIES (AND (NUMBERP D)
			(NOT (EQUAL Z 0))
			(NUMBERP Z)
			( LEQ Z (PLUS Z (TIMES D Z)))
			(NOT (EQUAL (REMAINDER (PLUS Y (TIMES D Z)) Z)
				    0))
			(NOT (EQUAL (REMAINDER Y Z) 0))
			(LESSP (PLUS Y (PLUS Z (TIMES D Z)))
			       Z))
		   (NOT (EQUAL (PLUS Y (PLUS Z (TIMES D Z)))
			       0))).

    This simplifies again, using linear arithmetic, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 23.0009358 1.04206543 ]

DIVIDES-PLUS-REWRITE2 


(PROVE-LEMMA DIVIDES-PLUS-REWRITE
	     (REWRITE)
	     (IMPLIES (EQUAL (REMAINDER X Z) 0.)
		      (EQUAL (EQUAL (REMAINDER (PLUS X Y) Z) 0.)
			     (EQUAL (REMAINDER Y Z) 0.))))
This simplifies, obviously, to the following two new conjectures:

Case 2. (IMPLIES (AND (EQUAL (REMAINDER X Z) 0)
		      (NOT (EQUAL (REMAINDER Y Z) 0)))
		 (NOT (EQUAL (REMAINDER (PLUS X Y) Z) 0))),

  which again simplifies, rewriting with DIVIDES-PLUS-REWRITE2, to:

        T.

Case 1. (IMPLIES (AND (EQUAL (REMAINDER X Z) 0)
		      (EQUAL (REMAINDER Y Z) 0))
		 (EQUAL (EQUAL (REMAINDER (PLUS X Y) Z) 0)
			T)).

  But this simplifies again, rewriting with DIVIDES-PLUS-REWRITE1,
  and unfolding the definition of EQUAL, to:

        T.

Q.E.D.


[ 4.0549967 0.072005209 ]

DIVIDES-PLUS-REWRITE 


(PROVE-LEMMA LESSP-PLUS-CANCELATION
	     (REWRITE)
	     (EQUAL (LESSP (PLUS X Y) (PLUS X Z))
		    (LESSP Y Z)))
This formula simplifies, rewriting with EQUAL-LESSP, to the following
two new goals:

Case 2. (IMPLIES ( LEQ (PLUS X Z) (PLUS X Y))
		 ( LEQ Z Y)),

  which we again simplify, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (LESSP (PLUS X Y) (PLUS X Z))
		 (LESSP Y Z)).

  However this again simplifies, using linear arithmetic, to:

        T.

Q.E.D.


[ 0.53999023 0.057006836 ]

LESSP-PLUS-CANCELATION 


(PROVE-LEMMA DIVIDES-PLUS-REWRITE-COMMUTED
	     (REWRITE)
	     (IMPLIES (EQUAL (REMAINDER X Z) 0.)
		      (EQUAL (EQUAL (REMAINDER (PLUS Y X) Z) 0.)
			     (EQUAL (REMAINDER Y Z) 0.))))
This simplifies, rewriting with COMMUTATIVITY-OF-PLUS and
DIVIDES-PLUS-REWRITE, to:

      T.

Q.E.D.


[ 1.54799804 0.015999349 ]

DIVIDES-PLUS-REWRITE-COMMUTED 


(PROVE-LEMMA EUCLID
	     (REWRITE)
	     (IMPLIES (EQUAL (REMAINDER X Z) 0.)
		      (EQUAL (EQUAL (REMAINDER (DIFFERENCE Y X) Z)
				    0.)
			     (IF (LESSP X Y)
				 (EQUAL (REMAINDER Y Z) 0.)
				 T))))
This formula simplifies, trivially, to the following three new goals:

Case 3. (IMPLIES (AND (EQUAL (REMAINDER X Z) 0)
		      (NOT (EQUAL (REMAINDER (DIFFERENCE Y X) Z)
				  0)))
		 (LESSP X Y)),

  which again simplifies, applying the lemma DIFFERENCE-0, and
  expanding the definitions of LESSP, EQUAL, NUMBERP, and REMAINDER,
  to:

        T.

Case 2. (IMPLIES (AND (EQUAL (REMAINDER X Z) 0)
		      (NOT (EQUAL (REMAINDER (DIFFERENCE Y X) Z)
				  0)))
		 (NOT (EQUAL (REMAINDER Y Z) 0))).

  Applying the lemmas DIFFERENCE-ELIM and REMAINDER-QUOTIENT-ELIM,
  replace Y by (PLUS X V) to eliminate (DIFFERENCE Y X) and V by
  (PLUS W (TIMES Z D)) to eliminate (REMAINDER V Z) and
  (QUOTIENT V Z).  We use the type restriction lemma noted when
  DIFFERENCE was introduced, LESSP-REMAINDER2, the type restriction
  lemma noted when REMAINDER was introduced, and the type restriction
  lemma noted when QUOTIENT was introduced to constrain the new
  variables.  We must thus prove the following five new conjectures:

  Case 2.5.
          (IMPLIES (AND (LESSP Y X)
			(EQUAL (REMAINDER X Z) 0)
			(NOT (EQUAL (REMAINDER (DIFFERENCE Y X) Z)
				    0)))
		   (NOT (EQUAL (REMAINDER Y Z) 0))).

    This simplifies further, using linear arithmetic, applying
    DIFFERENCE-0, and opening up LESSP, EQUAL, NUMBERP, and REMAINDER,
    to:

          T.

  Case 2.4.
          (IMPLIES (AND (NOT (NUMBERP Y))
			(EQUAL (REMAINDER X Z) 0)
			(NOT (EQUAL (REMAINDER (DIFFERENCE Y X) Z)
				    0)))
		   (NOT (EQUAL (REMAINDER Y Z) 0))),

    which we further simplify, using linear arithmetic, rewriting
    with DIFFERENCE-0, and unfolding the functions LESSP, EQUAL,
    NUMBERP, and REMAINDER, to:

          T.

  Case 2.3.
          (IMPLIES (AND (EQUAL Z 0)
			(NUMBERP V)
			( LEQ X (PLUS X V))
			(EQUAL (REMAINDER X Z) 0)
			(NOT (EQUAL (REMAINDER V Z) 0)))
		   (NOT (EQUAL (REMAINDER (PLUS X V) Z) 0))).

    But this simplifies further, applying COMMUTATIVITY-OF-PLUS and
    PLUS-RIGHT-ID2, and unfolding the definitions of EQUAL, REMAINDER,
    and PLUS, to:

          T.

  Case 2.2.
          (IMPLIES (AND (NOT (NUMBERP Z))
			(NUMBERP V)
			( LEQ X (PLUS X V))
			(EQUAL (REMAINDER X Z) 0)
			(NOT (EQUAL (REMAINDER V Z) 0)))
		   (NOT (EQUAL (REMAINDER (PLUS X V) Z) 0))),

    which we further simplify, rewriting with COMMUTATIVITY-OF-PLUS,
    REMAINDER-WRT-12, and PLUS-RIGHT-ID2, and expanding the
    definitions of EQUAL and PLUS, to:

          T.

  Case 2.1.
          (IMPLIES
		  (AND (NUMBERP W)
		       (EQUAL (LESSP W Z) (NOT (ZEROP Z)))
		       (NUMBERP D)
		       (NUMBERP Z)
		       (NOT (EQUAL Z 0))
		       ( LEQ X (PLUS X (PLUS W (TIMES Z D))))
		       (EQUAL (REMAINDER X Z) 0)
		       (NOT (EQUAL W 0)))
		  (NOT (EQUAL (REMAINDER (PLUS X (PLUS W (TIMES Z D)))
					 Z)
			      0))),

    which we further simplify, rewriting with the lemmas
    COMMUTATIVITY-OF-TIMES, COMMUTATIVITY2-OF-PLUS,
    DIVIDES-PLUS-REWRITE1, DIVIDES-TIMES, and
    DIVIDES-PLUS-REWRITE-COMMUTED, and unfolding ZEROP, NOT, EQUAL,
    and REMAINDER, to:

          T.

Case 1. (IMPLIES (AND (EQUAL (REMAINDER X Z) 0)
		      (EQUAL (REMAINDER (DIFFERENCE Y X) Z)
			     0)
		      (LESSP X Y))
		 (EQUAL (EQUAL (REMAINDER Y Z) 0)
			T)),

  which again simplifies, obviously, to:

        (IMPLIES (AND (EQUAL (REMAINDER X Z) 0)
		      (EQUAL (REMAINDER (DIFFERENCE Y X) Z)
			     0)
		      (LESSP X Y))
		 (EQUAL (REMAINDER Y Z) 0)).

  Appealing to the lemmas DIFFERENCE-ELIM and REMAINDER-QUOTIENT-ELIM,
  replace Y by (PLUS X V) to eliminate (DIFFERENCE Y X) and V by
  (PLUS W (TIMES Z D)) to eliminate (REMAINDER V Z) and
  (QUOTIENT V Z).  We employ the type restriction lemma noted when
  DIFFERENCE was introduced, LESSP-REMAINDER2, the type restriction
  lemma noted when REMAINDER was introduced, and the type restriction
  lemma noted when QUOTIENT was introduced to restrict the new
  variables.  We thus obtain five new formulas:

  Case 1.5.
          (IMPLIES (AND (LESSP Y X)
			(EQUAL (REMAINDER X Z) 0)
			(EQUAL (REMAINDER (DIFFERENCE Y X) Z)
			       0)
			(LESSP X Y))
		   (EQUAL (REMAINDER Y Z) 0)),

    which we further simplify, using linear arithmetic, to:

          T.

  Case 1.4.
          (IMPLIES (AND (NOT (NUMBERP Y))
			(EQUAL (REMAINDER X Z) 0)
			(EQUAL (REMAINDER (DIFFERENCE Y X) Z)
			       0)
			(LESSP X Y))
		   (EQUAL (REMAINDER Y Z) 0)).

    However this simplifies further, opening up DIFFERENCE, LESSP,
    EQUAL, NUMBERP, and REMAINDER, to:

          T.

  Case 1.3.
          (IMPLIES (AND (EQUAL Z 0)
			(NUMBERP V)
			( LEQ X (PLUS X V))
			(EQUAL (REMAINDER X Z) 0)
			(EQUAL (REMAINDER V Z) 0)
			(LESSP X (PLUS X V)))
		   (EQUAL (REMAINDER (PLUS X V) Z) 0)),

    which we further simplify, rewriting with the lemmas
    COMMUTATIVITY-OF-PLUS and PLUS-RIGHT-ID2, and expanding the
    definitions of EQUAL, REMAINDER, PLUS, LESSP, and NUMBERP, to:

          T.

  Case 1.2.
          (IMPLIES (AND (NOT (NUMBERP Z))
			(NUMBERP V)
			( LEQ X (PLUS X V))
			(EQUAL (REMAINDER X Z) 0)
			(EQUAL (REMAINDER V Z) 0)
			(LESSP X (PLUS X V)))
		   (EQUAL (REMAINDER (PLUS X V) Z) 0)).

    This further simplifies, rewriting with the lemmas
    COMMUTATIVITY-OF-PLUS, REMAINDER-WRT-12, and PLUS-RIGHT-ID2, and
    expanding the functions PLUS, LESSP, NUMBERP, and EQUAL, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NUMBERP W)
			(EQUAL (LESSP W Z) (NOT (ZEROP Z)))
			(NUMBERP D)
			(NUMBERP Z)
			(NOT (EQUAL Z 0))
			( LEQ X (PLUS X (PLUS W (TIMES Z D))))
			(EQUAL (REMAINDER X Z) 0)
			(EQUAL W 0)
			(LESSP X
			       (PLUS X (PLUS W (TIMES Z D)))))
		   (EQUAL (REMAINDER (PLUS X (PLUS W (TIMES Z D)))
				     Z)
			  0)).

    This simplifies further, applying COMMUTATIVITY-OF-TIMES,
    DIVIDES-TIMES, and DIVIDES-PLUS-REWRITE1, and expanding the
    functions NUMBERP, EQUAL, LESSP, ZEROP, NOT, and PLUS, to:

          T.

Q.E.D.


[ 11.6670166 0.67599284 ]

EUCLID 


(PROVE-LEMMA LESSP-TIMES-CANCELLATION
	     (REWRITE)
	     (EQUAL (LESSP (TIMES X Z) (TIMES Y Z))
		    (AND (NOT (ZEROP Z)) (LESSP X Y))))
This simplifies, appealing to the lemma EQUAL-LESSP, and expanding
the functions ZEROP, NOT, and AND, to four new formulas:

Case 4. (IMPLIES (AND ( LEQ (TIMES Y Z) (TIMES X Z))
		      (NOT (EQUAL Z 0))
		      (NUMBERP Z))
		 ( LEQ Y X)).

  Name the above subgoal *1.

Case 3. (IMPLIES (LESSP (TIMES X Z) (TIMES Y Z))
		 (LESSP X Y)),

  which we would normally push and work on later by induction.  But
  if we must use induction to prove the input conjecture, we prefer
  to induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us return to:

(EQUAL (LESSP (TIMES X Z) (TIMES Y Z))
       (AND (NOT (ZEROP Z)) (LESSP X Y))),

named *1.  We will try to prove it by induction.  Four inductions are
suggested by terms in the conjecture.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (ZEROP X) (P X Z Y))
	   (IMPLIES (AND (NOT (ZEROP X))
			 (P (SUB1 X) Z (SUB1 Y)))
		    (P X Z Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP can be used to establish that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  Note, however, the inductive instance chosen for Y.
The above induction scheme generates the following two new
conjectures:

Case 2. (IMPLIES (ZEROP X)
		 (EQUAL (LESSP (TIMES X Z) (TIMES Y Z))
			(AND (NOT (ZEROP Z)) (LESSP X Y)))),

  which we simplify, opening up ZEROP, EQUAL, TIMES, LESSP, NOT, and
  AND, to ten new goals:

  Case 2.10.
          (IMPLIES (AND (EQUAL X 0)
			(EQUAL Z 0)
			(NOT (EQUAL Y 0))
			(NUMBERP Y))
		   (EQUAL (PLUS Z (TIMES (SUB1 Y) Z))
			  0)).

    However this again simplifies, appealing to the lemma
    COMMUTATIVITY-OF-TIMES, and unfolding the definitions of EQUAL,
    TIMES, and PLUS, to:

          T.

  Case 2.9.
          (IMPLIES (AND (EQUAL X 0)
			(NOT (NUMBERP Z))
			(NOT (EQUAL Y 0))
			(NUMBERP Y))
		   (EQUAL (PLUS Z (TIMES (SUB1 Y) Z))
			  0)),

    which we again simplify, rewriting with EQUAL-TIMES-0, and
    opening up PLUS, to:

          T.

  Case 2.8.
          (IMPLIES (AND (EQUAL X 0)
			(NOT (EQUAL Z 0))
			(NUMBERP Z)
			(NOT (EQUAL Y 0))
			(EQUAL (PLUS Z (TIMES (SUB1 Y) Z))
			       0))
		   (EQUAL F (NUMBERP Y))),

    which again simplifies, using linear arithmetic, to:

          T.

  Case 2.7.
          (IMPLIES (AND (EQUAL X 0)
			(NOT (EQUAL Z 0))
			(NUMBERP Z)
			(NOT (EQUAL Y 0))
			(NOT (NUMBERP Y)))
		   (EQUAL F (NUMBERP Y))),

    which we again simplify, trivially, to:

          T.

  Case 2.6.
          (IMPLIES (AND (EQUAL X 0)
			(NOT (EQUAL Y 0))
			(NUMBERP Y)
			(NOT (EQUAL (PLUS Z (TIMES (SUB1 Y) Z))
				    0)))
		   (EQUAL T (NUMBERP Y))),

    which we again simplify, obviously, to:

          T.

  Case 2.5.
          (IMPLIES (AND (NOT (NUMBERP X))
			(EQUAL Z 0)
			(NOT (EQUAL Y 0))
			(NUMBERP Y))
		   (EQUAL (PLUS Z (TIMES (SUB1 Y) Z))
			  0)),

    which again simplifies, rewriting with COMMUTATIVITY-OF-TIMES,
    and expanding the definitions of EQUAL, TIMES, and PLUS, to:

          T.

  Case 2.4.
          (IMPLIES (AND (NOT (NUMBERP X))
			(NOT (NUMBERP Z))
			(NOT (EQUAL Y 0))
			(NUMBERP Y))
		   (EQUAL (PLUS Z (TIMES (SUB1 Y) Z))
			  0)).

    However this again simplifies, rewriting with the lemma
    EQUAL-TIMES-0, and unfolding the definition of PLUS, to:

          T.

  Case 2.3.
          (IMPLIES (AND (NOT (NUMBERP X))
			(NOT (EQUAL Z 0))
			(NUMBERP Z)
			(NOT (EQUAL Y 0))
			(EQUAL (PLUS Z (TIMES (SUB1 Y) Z))
			       0))
		   (EQUAL F (NUMBERP Y))),

    which again simplifies, using linear arithmetic, to:

          T.

  Case 2.2.
          (IMPLIES (AND (NOT (NUMBERP X))
			(NOT (EQUAL Z 0))
			(NUMBERP Z)
			(NOT (EQUAL Y 0))
			(NOT (NUMBERP Y)))
		   (EQUAL F (NUMBERP Y))),

    which we again simplify, trivially, to:

          T.

  Case 2.1.
          (IMPLIES (AND (NOT (NUMBERP X))
			(NOT (EQUAL Y 0))
			(NUMBERP Y)
			(NOT (EQUAL (PLUS Z (TIMES (SUB1 Y) Z))
				    0)))
		   (EQUAL T (NUMBERP Y))).

    This simplifies again, trivially, to:

          T.

Case 1. (IMPLIES (AND (NOT (ZEROP X))
		      (EQUAL (LESSP (TIMES (SUB1 X) Z)
				    (TIMES (SUB1 Y) Z))
			     (AND (NOT (ZEROP Z))
				  (LESSP (SUB1 X) (SUB1 Y)))))
		 (EQUAL (LESSP (TIMES X Z) (TIMES Y Z))
			(AND (NOT (ZEROP Z)) (LESSP X Y)))),

  which simplifies, applying EQUAL-LESSP, TIMES-ZERO2, and
  COMMUTATIVITY-OF-TIMES, and opening up the definitions of ZEROP,
  NOT, AND, TIMES, LESSP, and EQUAL, to the following six new goals:

  Case 1.6.
          (IMPLIES (AND (NOT (EQUAL X 0))
			(NUMBERP X)
			( LEQ
			  (TIMES (SUB1 Y) Z)
			  (TIMES (SUB1 X) Z))
			( LEQ (SUB1 Y) (SUB1 X))
			(NOT (EQUAL Y 0))
			(NUMBERP Y))
		   ( LEQ
		     (PLUS Z (TIMES (SUB1 Y) Z))
		     (PLUS Z (TIMES (SUB1 X) Z)))).

    This simplifies again, using linear arithmetic, to:

          T.

  Case 1.5.
          (IMPLIES (AND (NOT (EQUAL X 0))
			(NUMBERP X)
			( LEQ
			  (TIMES (SUB1 Y) Z)
			  (TIMES (SUB1 X) Z))
			( LEQ (SUB1 Y) (SUB1 X))
			(EQUAL Y 0))
		   ( LEQ 0
		     (PLUS Z (TIMES (SUB1 X) Z)))).

    This simplifies again, using linear arithmetic, to:

          T.

  Case 1.4.
          (IMPLIES (AND (NOT (EQUAL X 0))
			(NUMBERP X)
			( LEQ
			  (TIMES (SUB1 Y) Z)
			  (TIMES (SUB1 X) Z))
			( LEQ (SUB1 Y) (SUB1 X))
			(NOT (NUMBERP Y)))
		   ( LEQ 0
		     (PLUS Z (TIMES (SUB1 X) Z)))),

    which we again simplify, using linear arithmetic, to:

          T.

  Case 1.3.
          (IMPLIES (AND (NOT (EQUAL X 0))
			(NUMBERP X)
			(LESSP (TIMES (SUB1 X) Z)
			       (TIMES (SUB1 Y) Z))
			(NOT (EQUAL Z 0))
			(NUMBERP Z)
			(LESSP (SUB1 X) (SUB1 Y))
			(NOT (NUMBERP Y)))
		   ( LEQ 0
		     (PLUS Z (TIMES (SUB1 X) Z)))),

    which we again simplify, using linear arithmetic, to:

          T.

  Case 1.2.
          (IMPLIES (AND (NOT (EQUAL X 0))
			(NUMBERP X)
			(LESSP (TIMES (SUB1 X) Z)
			       (TIMES (SUB1 Y) Z))
			(NOT (EQUAL Z 0))
			(NUMBERP Z)
			(LESSP (SUB1 X) (SUB1 Y))
			(EQUAL Y 0))
		   ( LEQ 0
		     (PLUS Z (TIMES (SUB1 X) Z)))),

    which we again simplify, using linear arithmetic, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NOT (EQUAL X 0))
			(NUMBERP X)
			(LESSP (TIMES (SUB1 X) Z)
			       (TIMES (SUB1 Y) Z))
			(NOT (EQUAL Z 0))
			(NUMBERP Z)
			(LESSP (SUB1 X) (SUB1 Y))
			(NOT (EQUAL Y 0))
			(NUMBERP Y))
		   (LESSP (PLUS Z (TIMES (SUB1 X) Z))
			  (PLUS Z (TIMES (SUB1 Y) Z)))),

    which we again simplify, using linear arithmetic, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 5.5680176 0.82399089 ]

LESSP-TIMES-CANCELLATION 


(PROVE-LEMMA LESSP-PLUS-CANCELLATION3
	     (REWRITE)
	     (EQUAL (LESSP Y (PLUS X Y))
		    (NOT (ZEROP X))))
This formula simplifies, applying EQUAL-LESSP, and opening up ZEROP
and NOT, to the following three new goals:

Case 3. (IMPLIES (AND ( LEQ (PLUS X Y) Y)
		      (NOT (EQUAL X 0)))
		 (NOT (NUMBERP X))),

  which we again simplify, using linear arithmetic, to:

        T.

Case 2. (IMPLIES (LESSP Y (PLUS X Y))
		 (NUMBERP X)).

  However this again simplifies, opening up the definition of PLUS,
  to the following two new formulas:

  Case 2.2.
          (IMPLIES (AND (NOT (NUMBERP Y)) (LESSP Y 0))
		   (NUMBERP X)),

    which again simplifies, using linear arithmetic, to:

          T.

  Case 2.1.
          (IMPLIES (AND (NUMBERP Y) (LESSP Y Y))
		   (NUMBERP X)),

    which we again simplify, using linear arithmetic, to:

          T.

Case 1. (IMPLIES (LESSP Y (PLUS X Y))
		 (NOT (EQUAL X 0))),

  which we again simplify, using linear arithmetic, to:

        T.

Q.E.D.


[ 0.4240153 0.1259847 ]

LESSP-PLUS-CANCELLATION3 


(PROVE-LEMMA DISTRIBUTIVITY-OF-TIMES-OVER-GCD
	     (REWRITE)
	     (EQUAL (GCD (TIMES X Z) (TIMES Y Z))
		    (TIMES Z (GCD X Y))))

     Give the conjecture the name *1.


     We will try to prove it by induction.  Four inductions are
suggested by terms in the conjecture, three of which are unflawed.
So we will choose the one suggested by the largest number of
nonprimitive recursive functions.  We will induct according to the
following scheme:
      (AND (IMPLIES (ZEROP X) (P X Z Y))
	   (IMPLIES (AND (NOT (ZEROP X)) (ZEROP Y))
		    (P X Z Y))
	   (IMPLIES (AND (NOT (ZEROP X))
			 (NOT (ZEROP Y))
			 (LESSP X Y)
			 (P X Z (DIFFERENCE Y X)))
		    (P X Z Y))
	   (IMPLIES (AND (NOT (ZEROP X))
			 (NOT (ZEROP Y))
			 ( LEQ Y X)
			 (P (DIFFERENCE X Y) Z Y))
		    (P X Z Y))).
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, COUNT-NUMBERP, and
DIFFERENCE-CANCELLATION-0, and the definitions of LEX2 and ZEROP
establish that the measure (LIST (COUNT X) (COUNT Y)) decreases
according to the well-founded relation LEX2 in each induction step of
the scheme.  The above induction scheme leads to the following four
new goals:

Case 4. (IMPLIES (ZEROP X)
		 (EQUAL (GCD (TIMES X Z) (TIMES Y Z))
			(TIMES Z (GCD X Y)))),

  which simplifies, rewriting with GCD-0, and expanding the functions
  ZEROP, EQUAL, TIMES, and GCD, to four new conjectures:

  Case 4.4.
          (IMPLIES (AND (EQUAL X 0) (NOT (NUMBERP Y)))
		   (EQUAL (TIMES Y Z) (TIMES Z 0))),

    which we again simplify, rewriting with COMMUTATIVITY-OF-TIMES,
    and unfolding the functions TIMES and EQUAL, to:

          T.

  Case 4.3.
          (IMPLIES (AND (EQUAL X 0) (NUMBERP Y))
		   (EQUAL (TIMES Y Z) (TIMES Z Y))).

    However this again simplifies, appealing to the lemma
    COMMUTATIVITY-OF-TIMES, to:

          T.

  Case 4.2.
          (IMPLIES (AND (NOT (NUMBERP X))
			(NOT (NUMBERP Y)))
		   (EQUAL (TIMES Y Z) (TIMES Z 0))),

    which again simplifies, rewriting with COMMUTATIVITY-OF-TIMES,
    and expanding TIMES and EQUAL, to:

          T.

  Case 4.1.
          (IMPLIES (AND (NOT (NUMBERP X)) (NUMBERP Y))
		   (EQUAL (TIMES Y Z) (TIMES Z Y))),

    which we again simplify, applying COMMUTATIVITY-OF-TIMES, to:

          T.

Case 3. (IMPLIES (AND (NOT (ZEROP X)) (ZEROP Y))
		 (EQUAL (GCD (TIMES X Z) (TIMES Y Z))
			(TIMES Z (GCD X Y)))).

  This simplifies, applying GCD-0, COMMUTATIVITY-OF-GCD, and
  COMMUTATIVITY-OF-TIMES, and opening up ZEROP, EQUAL, TIMES, and GCD,
  to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP X))
		      (NOT (ZEROP Y))
		      (LESSP X Y)
		      (EQUAL (GCD (TIMES X Z)
				  (TIMES (DIFFERENCE Y X) Z))
			     (TIMES Z (GCD X (DIFFERENCE Y X)))))
		 (EQUAL (GCD (TIMES X Z) (TIMES Y Z))
			(TIMES Z (GCD X Y)))),

  which simplifies, using linear arithmetic, applying
  TIMES-DIFFERENCE, COMMUTATIVITY-OF-TIMES, GCD-0, DIFFERENCE-0,
  LESSP-TIMES-CANCELLATION, and EQUAL-TIMES-0, and expanding ZEROP
  and GCD, to two new conjectures:

  Case 2.2.
          (IMPLIES
		(AND (NOT (EQUAL X 0))
		     (NUMBERP X)
		     (NOT (EQUAL Y 0))
		     (NUMBERP Y)
		     (LESSP X Y)
		     (EQUAL (GCD (TIMES X Z)
				 (DIFFERENCE (TIMES Y Z) (TIMES X Z)))
			    (TIMES Z (GCD X (DIFFERENCE Y X))))
		     (NOT (NUMBERP Z)))
		(EQUAL (TIMES Y Z)
		       (TIMES Z (GCD X (DIFFERENCE Y X))))).

    However this again simplifies, rewriting with the lemma
    TIMES-ZERO2, and unfolding the definitions of DIFFERENCE, GCD,
    TIMES, and EQUAL, to:

          T.

  Case 2.1.
          (IMPLIES
		(AND (NOT (EQUAL X 0))
		     (NUMBERP X)
		     (NOT (EQUAL Y 0))
		     (NUMBERP Y)
		     (LESSP X Y)
		     (EQUAL (GCD (TIMES X Z)
				 (DIFFERENCE (TIMES Y Z) (TIMES X Z)))
			    (TIMES Z (GCD X (DIFFERENCE Y X))))
		     (EQUAL Z 0))
		(EQUAL (TIMES Y Z)
		       (TIMES Z (GCD X (DIFFERENCE Y X))))),

    which again simplifies, rewriting with COMMUTATIVITY-OF-TIMES,
    and unfolding the functions EQUAL, TIMES, DIFFERENCE, and GCD, to:

          T.

Case 1. (IMPLIES (AND (NOT (ZEROP X))
		      (NOT (ZEROP Y))
		      ( LEQ Y X)
		      (EQUAL (GCD (TIMES (DIFFERENCE X Y) Z)
				  (TIMES Y Z))
			     (TIMES Z (GCD (DIFFERENCE X Y) Y))))
		 (EQUAL (GCD (TIMES X Z) (TIMES Y Z))
			(TIMES Z (GCD X Y)))).

  This simplifies, applying TIMES-DIFFERENCE, COMMUTATIVITY-OF-TIMES,
  and COMMUTATIVITY-OF-GCD, and opening up ZEROP and GCD, to:

        (IMPLIES
		(AND (NOT (EQUAL X 0))
		     (NUMBERP X)
		     (NOT (EQUAL Y 0))
		     (NUMBERP Y)
		     ( LEQ Y X)
		     (EQUAL (GCD (TIMES Y Z)
				 (DIFFERENCE (TIMES X Z) (TIMES Y Z)))
			    (TIMES Z (GCD (DIFFERENCE X Y) Y))))
		(EQUAL (GCD (TIMES X Z) (TIMES Y Z))
		       (TIMES Z (GCD (DIFFERENCE X Y) Y)))),

  which further simplifies, applying COMMUTATIVITY-OF-GCD, to the new
  formula:

        (IMPLIES
		(AND (NOT (EQUAL X 0))
		     (NUMBERP X)
		     (NOT (EQUAL Y 0))
		     (NUMBERP Y)
		     ( LEQ Y X)
		     (EQUAL (GCD (TIMES Y Z)
				 (DIFFERENCE (TIMES X Z) (TIMES Y Z)))
			    (TIMES Z (GCD Y (DIFFERENCE X Y)))))
		(EQUAL (GCD (TIMES X Z) (TIMES Y Z))
		       (TIMES Z (GCD Y (DIFFERENCE X Y))))).

  Applying the lemma DIFFERENCE-ELIM, we now replace X by (PLUS Y V)
  to eliminate (DIFFERENCE X Y).  We use the type restriction lemma
  noted when DIFFERENCE was introduced to restrict the new variable.
  We thus obtain:

        (IMPLIES (AND (NUMBERP V)
		      (NOT (EQUAL (PLUS Y V) 0))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      ( LEQ Y (PLUS Y V))
		      (EQUAL (GCD (TIMES Y Z)
				  (DIFFERENCE (TIMES (PLUS Y V) Z)
					      (TIMES Y Z)))
			     (TIMES Z (GCD Y V))))
		 (EQUAL (GCD (TIMES (PLUS Y V) Z) (TIMES Y Z))
			(TIMES Z (GCD Y V)))),

  which we further simplify, using linear arithmetic, applying
  COMMUTATIVITY-OF-PLUS, PLUS-EQUAL-0, COMMUTATIVITY-OF-TIMES,
  DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, DIFFERENCE-PLUS2,
  COMMUTATIVITY-OF-GCD, GCD-0, DIFFERENCE-0, LESSP-PLUS-CANCELLATION3,
  and EQUAL-TIMES-0, and opening up the functions GCD, PLUS, EQUAL,
  and TIMES, to three new goals:

  Case 1.3.
          (IMPLIES (AND (NUMBERP V)
			(NOT (EQUAL Y 0))
			(NUMBERP Y)
			( LEQ Y (PLUS V Y))
			(EQUAL (GCD (TIMES V Z) (TIMES Y Z))
			       (TIMES Z (GCD V Y)))
			(EQUAL Z 0))
		   (EQUAL (TIMES Y Z)
			  (TIMES Z (GCD V Y)))),

    which we again simplify, rewriting with COMMUTATIVITY-OF-TIMES,
    and opening up the functions EQUAL, TIMES, and GCD, to:

          T.

  Case 1.2.
          (IMPLIES (AND (NUMBERP V)
			(NOT (EQUAL Y 0))
			(NUMBERP Y)
			( LEQ Y (PLUS V Y))
			(EQUAL (GCD (TIMES V Z) (TIMES Y Z))
			       (TIMES Z (GCD V Y)))
			(NOT (NUMBERP Z)))
		   (EQUAL (TIMES Y Z)
			  (TIMES Z (GCD V Y)))),

    which again simplifies, applying TIMES-ZERO2, and opening up the
    definitions of GCD, TIMES, and EQUAL, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NUMBERP V)
			(NOT (EQUAL Y 0))
			(NUMBERP Y)
			( LEQ Y (PLUS V Y))
			(EQUAL (GCD (TIMES V Z) (TIMES Y Z))
			       (TIMES Z (GCD V Y)))
			(EQUAL V 0))
		   (EQUAL (TIMES Y Z)
			  (TIMES Z (GCD V Y)))),

    which we again simplify, applying GCD-0 and
    COMMUTATIVITY-OF-TIMES, and expanding NUMBERP, EQUAL, PLUS, and
    TIMES, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 31.5249836 0.83301595 ]

DISTRIBUTIVITY-OF-TIMES-OVER-GCD 


(PROVE-LEMMA GCD-DIVIDES-BOTH
	     (REWRITE)
	     (AND (EQUAL (REMAINDER X (GCD X Y)) 0.)
		  (EQUAL (REMAINDER Y (GCD X Y)) 0.)))
This conjecture can be simplified, using the abbreviation AND, to two
new goals:

Case 2. (EQUAL (REMAINDER X (GCD X Y)) 0),

  which we will name *1.

Case 1. (EQUAL (REMAINDER Y (GCD X Y)) 0),

  which we would normally push and work on later by induction.  But
  if we must use induction to prove the input conjecture, we prefer
  to induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us return to:

(AND (EQUAL (REMAINDER X (GCD X Y)) 0)
     (EQUAL (REMAINDER Y (GCD X Y)) 0)).

We gave this the name *1 above.  We will appeal to induction.  Four
inductions are suggested by terms in the conjecture.  They merge into
three likely candidate inductions, all of which are unflawed.  So we
will choose the one suggested by the largest number of nonprimitive
recursive functions.  We will induct according to the following
scheme:
      (AND (IMPLIES (ZEROP X) (P Y X))
	   (IMPLIES (AND (NOT (ZEROP X)) (ZEROP Y))
		    (P Y X))
	   (IMPLIES (AND (NOT (ZEROP X))
			 (NOT (ZEROP Y))
			 (LESSP X Y)
			 (P (DIFFERENCE Y X) X))
		    (P Y X))
	   (IMPLIES (AND (NOT (ZEROP X))
			 (NOT (ZEROP Y))
			 ( LEQ Y X)
			 (P Y (DIFFERENCE X Y)))
		    (P Y X))).
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, COUNT-NUMBERP, and
DIFFERENCE-CANCELLATION-0, and the definitions of LEX2 and ZEROP
establish that the measure (LIST (COUNT X) (COUNT Y)) decreases
according to the well-founded relation LEX2 in each induction step of
the scheme.  The above induction scheme generates eight new formulas:

Case 8. (IMPLIES (ZEROP X)
		 (EQUAL (REMAINDER X (GCD X Y)) 0)),

  which we simplify, rewriting with GCD-0, and unfolding the
  functions ZEROP, LESSP, EQUAL, NUMBERP, REMAINDER, and GCD, to:

        T.

Case 7. (IMPLIES (AND (NOT (ZEROP X)) (ZEROP Y))
		 (EQUAL (REMAINDER X (GCD X Y)) 0)).

  This simplifies, rewriting with GCD-0, COMMUTATIVITY-OF-GCD, and
  REMAINDER-X-X, and expanding ZEROP, EQUAL, and GCD, to:

        T.

Case 6. (IMPLIES (AND (NOT (ZEROP X))
		      (NOT (ZEROP Y))
		      (LESSP X Y)
		      (EQUAL (REMAINDER X (GCD X (DIFFERENCE Y X)))
			     0)
		      (EQUAL (REMAINDER (DIFFERENCE Y X)
					(GCD X (DIFFERENCE Y X)))
			     0))
		 (EQUAL (REMAINDER X (GCD X Y)) 0)),

  which we simplify, rewriting with the lemma EUCLID, and expanding
  the definitions of ZEROP, GCD, and EQUAL, to:

        T.

Case 5. (IMPLIES (AND (NOT (ZEROP X))
		      (NOT (ZEROP Y))
		      ( LEQ Y X)
		      (EQUAL (REMAINDER (DIFFERENCE X Y)
					(GCD (DIFFERENCE X Y) Y))
			     0)
		      (EQUAL (REMAINDER Y (GCD (DIFFERENCE X Y) Y))
			     0))
		 (EQUAL (REMAINDER X (GCD X Y)) 0)),

  which we simplify, rewriting with the lemma EUCLID, and unfolding
  ZEROP, GCD, and EQUAL, to:

        (IMPLIES (AND (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      ( LEQ Y X)
		      ( LEQ X Y)
		      (EQUAL (REMAINDER Y (GCD (DIFFERENCE X Y) Y))
			     0))
		 (EQUAL (REMAINDER X (GCD (DIFFERENCE X Y) Y))
			0)).

  However this simplifies again, using linear arithmetic, to:

        (IMPLIES (AND (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL X 0))
		      (NUMBERP X)
		      ( LEQ X X)
		      ( LEQ X X)
		      (EQUAL (REMAINDER X (GCD (DIFFERENCE X X) X))
			     0))
		 (EQUAL (REMAINDER X (GCD (DIFFERENCE X X) X))
			0)).

  This again simplifies, trivially, to:

        T.

Case 4. (IMPLIES (ZEROP X)
		 (EQUAL (REMAINDER Y (GCD X Y)) 0)),

  which simplifies, applying GCD-0, and opening up the definitions of
  ZEROP and GCD, to four new formulas:

  Case 4.4.
          (IMPLIES (AND (EQUAL X 0) (NOT (NUMBERP Y)))
		   (EQUAL (REMAINDER Y 0) 0)),

    which again simplifies, expanding the definitions of EQUAL and
    REMAINDER, to:

          T.

  Case 4.3.
          (IMPLIES (AND (EQUAL X 0) (NUMBERP Y))
		   (EQUAL (REMAINDER Y Y) 0)).

    However this again simplifies, applying REMAINDER-X-X, and
    opening up the definition of EQUAL, to:

          T.

  Case 4.2.
          (IMPLIES (AND (NOT (NUMBERP X))
			(NOT (NUMBERP Y)))
		   (EQUAL (REMAINDER Y 0) 0)).

    But this again simplifies, expanding the functions EQUAL and
    REMAINDER, to:

          T.

  Case 4.1.
          (IMPLIES (AND (NOT (NUMBERP X)) (NUMBERP Y))
		   (EQUAL (REMAINDER Y Y) 0)).

    This simplifies again, applying REMAINDER-X-X, and expanding the
    function EQUAL, to:

          T.

Case 3. (IMPLIES (AND (NOT (ZEROP X)) (ZEROP Y))
		 (EQUAL (REMAINDER Y (GCD X Y)) 0)),

  which we simplify, applying the lemmas GCD-0 and
  COMMUTATIVITY-OF-GCD, and opening up the definitions of ZEROP,
  NUMBERP, LESSP, EQUAL, REMAINDER, and GCD, to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP X))
		      (NOT (ZEROP Y))
		      (LESSP X Y)
		      (EQUAL (REMAINDER X (GCD X (DIFFERENCE Y X)))
			     0)
		      (EQUAL (REMAINDER (DIFFERENCE Y X)
					(GCD X (DIFFERENCE Y X)))
			     0))
		 (EQUAL (REMAINDER Y (GCD X Y)) 0)),

  which we simplify, appealing to the lemma EUCLID, and unfolding the
  functions ZEROP, GCD, and EQUAL, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP X))
		      (NOT (ZEROP Y))
		      ( LEQ Y X)
		      (EQUAL (REMAINDER (DIFFERENCE X Y)
					(GCD (DIFFERENCE X Y) Y))
			     0)
		      (EQUAL (REMAINDER Y (GCD (DIFFERENCE X Y) Y))
			     0))
		 (EQUAL (REMAINDER Y (GCD X Y)) 0)).

  This simplifies, applying EUCLID, and opening up ZEROP, GCD, and
  EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 15.1310059 0.71099447 ]

GCD-DIVIDES-BOTH 


(PROVE-LEMMA GCD-IS-THE-GREATEST NIL
	     (IMPLIES (AND (NOT (ZEROP X))
			   (NOT (ZEROP Y))
			   (DIVIDES Z X)
			   (DIVIDES Z Y))
		      (LEQ Z (GCD X Y))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT,
AND, IMPLIES, and DIVIDES, to the new conjecture:

      (IMPLIES (AND (NOT (EQUAL X 0))
		    (NUMBERP X)
		    (NOT (EQUAL Y 0))
		    (NUMBERP Y)
		    (EQUAL (REMAINDER X Z) 0)
		    (EQUAL (REMAINDER Y Z) 0))
	       ( LEQ Z (GCD X Y))).

Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace X by
(PLUS V (TIMES Z W)) to eliminate (REMAINDER X Z) and (QUOTIENT X Z).
We use LESSP-REMAINDER2, the type restriction lemma noted when
REMAINDER was introduced, and the type restriction lemma noted when
QUOTIENT was introduced to constrain the new variables.  We would
thus like to prove the following three new formulas:

Case 3. (IMPLIES (AND (EQUAL Z 0)
		      (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (EQUAL (REMAINDER X Z) 0)
		      (EQUAL (REMAINDER Y Z) 0))
		 ( LEQ Z (GCD X Y))),

  which simplifies, using linear arithmetic, to:

        T.

Case 2. (IMPLIES (AND (NOT (NUMBERP Z))
		      (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (EQUAL (REMAINDER X Z) 0)
		      (EQUAL (REMAINDER Y Z) 0))
		 ( LEQ Z (GCD X Y))),

  which we simplify, applying REMAINDER-WRT-12, to:

        T.

Case 1. (IMPLIES (AND (NUMBERP V)
		      (EQUAL (LESSP V Z) (NOT (ZEROP Z)))
		      (NUMBERP W)
		      (NUMBERP Z)
		      (NOT (EQUAL Z 0))
		      (NOT (EQUAL (PLUS V (TIMES Z W)) 0))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (EQUAL V 0)
		      (EQUAL (REMAINDER Y Z) 0))
		 ( LEQ Z
		   (GCD (PLUS V (TIMES Z W)) Y))),

  which simplifies, rewriting with COMMUTATIVITY-OF-TIMES,
  EQUAL-TIMES-0, and COMMUTATIVITY-OF-GCD, and opening up NUMBERP,
  EQUAL, LESSP, ZEROP, NOT, and PLUS, to:

        (IMPLIES (AND (NUMBERP W)
		      (NUMBERP Z)
		      (NOT (EQUAL Z 0))
		      (NOT (EQUAL W 0))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (EQUAL (REMAINDER Y Z) 0))
		 ( LEQ Z (GCD Y (TIMES W Z)))).

  Appealing to the lemma REMAINDER-QUOTIENT-ELIM, replace Y by
  (PLUS V (TIMES Z D)) to eliminate (REMAINDER Y Z) and
  (QUOTIENT Y Z).  We use LESSP-REMAINDER2, the type restriction
  lemma noted when REMAINDER was introduced, and the type restriction
  lemma noted when QUOTIENT was introduced to constrain the new
  variables.  The result is:

        (IMPLIES (AND (NUMBERP V)
		      (EQUAL (LESSP V Z) (NOT (ZEROP Z)))
		      (NUMBERP D)
		      (NUMBERP W)
		      (NUMBERP Z)
		      (NOT (EQUAL Z 0))
		      (NOT (EQUAL W 0))
		      (NOT (EQUAL (PLUS V (TIMES Z D)) 0))
		      (EQUAL V 0))
		 ( LEQ Z
		   (GCD (PLUS V (TIMES Z D))
			(TIMES W Z)))),

  which we further simplify, rewriting with the lemmas
  COMMUTATIVITY-OF-TIMES, EQUAL-TIMES-0, and
  DISTRIBUTIVITY-OF-TIMES-OVER-GCD, and expanding the definitions of
  NUMBERP, EQUAL, LESSP, ZEROP, NOT, and PLUS, to:

        (IMPLIES (AND (NUMBERP D)
		      (NUMBERP W)
		      (NUMBERP Z)
		      (NOT (EQUAL Z 0))
		      (NOT (EQUAL W 0))
		      (NOT (EQUAL D 0)))
		 ( LEQ Z (TIMES Z (GCD D W)))),

  which we again simplify, using linear arithmetic and rewriting with
  LESSP-TIMES-2 and GCD-EQUAL-0, to:

        T.

Q.E.D.


[ 5.6500244 0.36497396 ]

GCD-IS-THE-GREATEST 


(ADD-SHELL CONS-IF NIL IF-EXPRP
	   ((TEST (NONE-OF) ZERO)
	    (LEFT-BRANCH (NONE-OF) ZERO)
	    (RIGHT-BRANCH (NONE-OF) ZERO)))

[ 0.587996416 0.0 ]

CONS-IF 


(DEFN ASSIGNMENT
      (VAR ALIST)
      (IF (EQUAL VAR T)
	  T
	  (IF (EQUAL VAR F)
	      F
	      (IF (NLISTP ALIST)
		  F
		  (IF (EQUAL VAR (CAAR ALIST))
		      (CDAR ALIST)
		      (ASSIGNMENT VAR (CDR ALIST)))))))
     Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP establish that the measure (COUNT ALIST)
decreases according to the well-founded relation LESSP in each
recursive call.  Hence, ASSIGNMENT is accepted under the principle of
definition.




[ 0.50100098 0.0379964192 ]

ASSIGNMENT 


(DEFN VALUE
      (X ALIST)
      (IF (IF-EXPRP X)
	  (IF (VALUE (TEST X) ALIST)
	      (VALUE (LEFT-BRANCH X) ALIST)
	      (VALUE (RIGHT-BRANCH X) ALIST))
	  (ASSIGNMENT X ALIST)))
     Linear arithmetic and the lemmas TEST-LESSP, LEFT-BRANCH-LESSP,
and RIGHT-BRANCH-LESSP inform us that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, VALUE is accepted under the definitional principle.




[ 0.169995118 0.037003581 ]

VALUE 


(DEFN IF-DEPTH
      (X)
      (IF (IF-EXPRP X)
	  (ADD1 (IF-DEPTH (TEST X)))
	  0.))
     Linear arithmetic and the lemma TEST-LESSP inform us that the
measure (COUNT X) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, IF-DEPTH is accepted under the
principle of definition.  Observe that (NUMBERP (IF-DEPTH X)) is a
theorem.




[ 1.03800456 0.038997396 ]

IF-DEPTH 


(DEFN IF-COMPLEXITY
      (X)
      (IF (IF-EXPRP X)
	  (TIMES (IF-COMPLEXITY (TEST X))
		 (PLUS (IF-COMPLEXITY (LEFT-BRANCH X))
		       (IF-COMPLEXITY (RIGHT-BRANCH X))))
	  1.))
     Linear arithmetic and the lemmas RIGHT-BRANCH-LESSP,
LEFT-BRANCH-LESSP, and TEST-LESSP establish that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each recursive call.  Hence, IF-COMPLEXITY is accepted under the
principle of definition.  Observe that (NUMBERP (IF-COMPLEXITY X)) is
a theorem.




[ 0.15 0.043994141 ]

IF-COMPLEXITY 


(PROVE-LEMMA IF-COMPLEXITY-NOT-0
	     (REWRITE)
	     (NOT (EQUAL (IF-COMPLEXITY X) 0.)))

     Give the conjecture the name *1.


     We will try to prove it by induction.  There is only one
plausible induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (AND (IF-EXPRP X)
			 (P (RIGHT-BRANCH X))
			 (P (LEFT-BRANCH X))
			 (P (TEST X)))
		    (P X))
	   (IMPLIES (NOT (IF-EXPRP X)) (P X))).
Linear arithmetic and the lemmas RIGHT-BRANCH-LESSP,
LEFT-BRANCH-LESSP, and TEST-LESSP establish that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme leads
to the following two new goals:

Case 2. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (EQUAL (IF-COMPLEXITY (RIGHT-BRANCH X))
				  0))
		      (NOT (EQUAL (IF-COMPLEXITY (LEFT-BRANCH X))
				  0))
		      (NOT (EQUAL (IF-COMPLEXITY (TEST X)) 0)))
		 (NOT (EQUAL (IF-COMPLEXITY X) 0))),

  which simplifies, rewriting with COMMUTATIVITY-OF-TIMES,
  DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, EQUAL-TIMES-0, and PLUS-EQUAL-0,
  and expanding the function IF-COMPLEXITY, to:

        T.

Case 1. (IMPLIES (NOT (IF-EXPRP X))
		 (NOT (EQUAL (IF-COMPLEXITY X) 0))),

  which we simplify, expanding the functions IF-COMPLEXITY and EQUAL,
  to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.73399251 0.16200358 ]

IF-COMPLEXITY-NOT-0 


(PROVE-LEMMA IF-COMPLEXITY-GOES-DOWN1
	     (REWRITE)
	     (IMPLIES (IF-EXPRP X)
		      (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
			     (IF-COMPLEXITY X))))
.

Appealing to the lemma TEST-LEFT-BRANCH-RIGHT-BRANCH-ELIM, replace X
by (CONS-IF W Z V) to eliminate (LEFT-BRANCH X), (RIGHT-BRANCH X),
and (TEST X).  This produces:

      (LESSP (IF-COMPLEXITY Z)
	     (IF-COMPLEXITY (CONS-IF W Z V))).

This simplifies, applying DISTRIBUTIVITY-OF-TIMES-OVER-PLUS,
COMMUTATIVITY-OF-TIMES, COMMUTATIVITY-OF-PLUS, RIGHT-BRANCH-CONS-IF,
LEFT-BRANCH-CONS-IF, and TEST-CONS-IF, and unfolding the function
IF-COMPLEXITY, to the new formula:

      (LESSP (IF-COMPLEXITY Z)
	     (PLUS (TIMES (IF-COMPLEXITY V)
			  (IF-COMPLEXITY W))
		   (TIMES (IF-COMPLEXITY W)
			  (IF-COMPLEXITY Z)))),

which we would usually push and work on later by induction.  But if
we must use induction to prove the input conjecture, we prefer to
induct on the original formulation of the problem.  Thus we will
disregard all that we have previously done, give the name *1 to the
original input, and work on it.


     So now let us consider:

(IMPLIES (IF-EXPRP X)
	 (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
		(IF-COMPLEXITY X))).

We gave this the name *1 above.  We will try to prove it by induction.
There is only one plausible induction.  We will induct according to
the following scheme:
      (AND (IMPLIES (AND (IF-EXPRP X)
			 (P (RIGHT-BRANCH X))
			 (P (LEFT-BRANCH X))
			 (P (TEST X)))
		    (P X))
	   (IMPLIES (NOT (IF-EXPRP X)) (P X))).
Linear arithmetic and the lemmas RIGHT-BRANCH-LESSP,
LEFT-BRANCH-LESSP, and TEST-LESSP inform us that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme leads
to eight new goals:

Case 8. (IMPLIES (AND (NOT (IF-EXPRP (RIGHT-BRANCH X)))
		      (NOT (IF-EXPRP (LEFT-BRANCH X)))
		      (NOT (IF-EXPRP (TEST X)))
		      (IF-EXPRP X))
		 (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
			(IF-COMPLEXITY X))).

  This simplifies, appealing to the lemmas COMMUTATIVITY-OF-TIMES and
  DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, and opening up IF-COMPLEXITY, to:

        (IMPLIES (AND (NOT (IF-EXPRP (RIGHT-BRANCH X)))
		      (NOT (IF-EXPRP (LEFT-BRANCH X)))
		      (NOT (IF-EXPRP (TEST X)))
		      (IF-EXPRP X))
		 (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
			(PLUS (TIMES (IF-COMPLEXITY (LEFT-BRANCH X))
				     (IF-COMPLEXITY (TEST X)))
			      (TIMES (IF-COMPLEXITY (RIGHT-BRANCH X))
				     (IF-COMPLEXITY (TEST X)))))),

  which we again simplify, using linear arithmetic and rewriting with
  LESSP-TIMES-2 and IF-COMPLEXITY-NOT-0, to the new conjecture:

        (IMPLIES (AND (EQUAL (TIMES (IF-COMPLEXITY (LEFT-BRANCH X))
				    (IF-COMPLEXITY (TEST X)))
			     (IF-COMPLEXITY (LEFT-BRANCH X)))
		      (NOT (IF-EXPRP (RIGHT-BRANCH X)))
		      (NOT (IF-EXPRP (LEFT-BRANCH X)))
		      (NOT (IF-EXPRP (TEST X)))
		      (IF-EXPRP X))
		 (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
			(PLUS (IF-COMPLEXITY (LEFT-BRANCH X))
			      (TIMES (IF-COMPLEXITY (RIGHT-BRANCH X))
				     (IF-COMPLEXITY (TEST X)))))).

  This simplifies further, opening up IF-COMPLEXITY, TIMES, EQUAL,
  PLUS, and LESSP, to:

        T.

Case 7. (IMPLIES
	    (AND (LESSP (IF-COMPLEXITY (LEFT-BRANCH (RIGHT-BRANCH X)))
			(IF-COMPLEXITY (RIGHT-BRANCH X)))
		 (NOT (IF-EXPRP (LEFT-BRANCH X)))
		 (NOT (IF-EXPRP (TEST X)))
		 (IF-EXPRP X))
	    (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
		   (IF-COMPLEXITY X))),

  which simplifies, applying COMMUTATIVITY-OF-TIMES and
  DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, and expanding IF-COMPLEXITY, to:

        (IMPLIES
	    (AND (LESSP (IF-COMPLEXITY (LEFT-BRANCH (RIGHT-BRANCH X)))
			(IF-COMPLEXITY (RIGHT-BRANCH X)))
		 (NOT (IF-EXPRP (LEFT-BRANCH X)))
		 (NOT (IF-EXPRP (TEST X)))
		 (IF-EXPRP X))
	    (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
		   (PLUS (TIMES (IF-COMPLEXITY (LEFT-BRANCH X))
				(IF-COMPLEXITY (TEST X)))
			 (TIMES (IF-COMPLEXITY (RIGHT-BRANCH X))
				(IF-COMPLEXITY (TEST X)))))).

  But this simplifies again, using linear arithmetic and applying
  LESSP-TIMES-2 and IF-COMPLEXITY-NOT-0, to:

        T.

Case 6. (IMPLIES
	     (AND (NOT (IF-EXPRP (RIGHT-BRANCH X)))
		  (LESSP (IF-COMPLEXITY (LEFT-BRANCH (LEFT-BRANCH X)))
			 (IF-COMPLEXITY (LEFT-BRANCH X)))
		  (NOT (IF-EXPRP (TEST X)))
		  (IF-EXPRP X))
	     (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
		    (IF-COMPLEXITY X))),

  which we simplify, rewriting with COMMUTATIVITY-OF-TIMES and
  DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, and expanding the function
  IF-COMPLEXITY, to:

        (IMPLIES
	     (AND (NOT (IF-EXPRP (RIGHT-BRANCH X)))
		  (LESSP (IF-COMPLEXITY (LEFT-BRANCH (LEFT-BRANCH X)))
			 (IF-COMPLEXITY (LEFT-BRANCH X)))
		  (NOT (IF-EXPRP (TEST X)))
		  (IF-EXPRP X))
	     (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
		    (PLUS (TIMES (IF-COMPLEXITY (LEFT-BRANCH X))
				 (IF-COMPLEXITY (TEST X)))
			  (TIMES (IF-COMPLEXITY (RIGHT-BRANCH X))
				 (IF-COMPLEXITY (TEST X)))))),

  which we again simplify, using linear arithmetic and rewriting with
  the lemmas LESSP-TIMES-2 and IF-COMPLEXITY-NOT-0, to:

        (IMPLIES
	     (AND (EQUAL (TIMES (IF-COMPLEXITY (LEFT-BRANCH X))
				(IF-COMPLEXITY (TEST X)))
			 (IF-COMPLEXITY (LEFT-BRANCH X)))
		  (NOT (IF-EXPRP (RIGHT-BRANCH X)))
		  (LESSP (IF-COMPLEXITY (LEFT-BRANCH (LEFT-BRANCH X)))
			 (IF-COMPLEXITY (LEFT-BRANCH X)))
		  (NOT (IF-EXPRP (TEST X)))
		  (IF-EXPRP X))
	     (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
		    (PLUS (IF-COMPLEXITY (LEFT-BRANCH X))
			  (TIMES (IF-COMPLEXITY (RIGHT-BRANCH X))
				 (IF-COMPLEXITY (TEST X)))))),

  which further simplifies, rewriting with COMMUTATIVITY-OF-TIMES,
  COMMUTATIVITY-OF-PLUS, and LESSP-PLUS-CANCELLATION3, and expanding
  the definitions of IF-COMPLEXITY, TIMES, EQUAL, and NUMBERP, to:

        T.

Case 5. (IMPLIES
	    (AND (LESSP (IF-COMPLEXITY (LEFT-BRANCH (RIGHT-BRANCH X)))
			(IF-COMPLEXITY (RIGHT-BRANCH X)))
		 (LESSP (IF-COMPLEXITY (LEFT-BRANCH (LEFT-BRANCH X)))
			(IF-COMPLEXITY (LEFT-BRANCH X)))
		 (NOT (IF-EXPRP (TEST X)))
		 (IF-EXPRP X))
	    (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
		   (IF-COMPLEXITY X))).

  This simplifies, appealing to the lemmas COMMUTATIVITY-OF-TIMES and
  DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, and unfolding the definition of
  IF-COMPLEXITY, to the conjecture:

        (IMPLIES
	    (AND (LESSP (IF-COMPLEXITY (LEFT-BRANCH (RIGHT-BRANCH X)))
			(IF-COMPLEXITY (RIGHT-BRANCH X)))
		 (LESSP (IF-COMPLEXITY (LEFT-BRANCH (LEFT-BRANCH X)))
			(IF-COMPLEXITY (LEFT-BRANCH X)))
		 (NOT (IF-EXPRP (TEST X)))
		 (IF-EXPRP X))
	    (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
		   (PLUS (TIMES (IF-COMPLEXITY (LEFT-BRANCH X))
				(IF-COMPLEXITY (TEST X)))
			 (TIMES (IF-COMPLEXITY (RIGHT-BRANCH X))
				(IF-COMPLEXITY (TEST X)))))),

  which we again simplify, using linear arithmetic and applying
  LESSP-TIMES-2 and IF-COMPLEXITY-NOT-0, to:

        T.

Case 4. (IMPLIES (AND (NOT (IF-EXPRP (RIGHT-BRANCH X)))
		      (NOT (IF-EXPRP (LEFT-BRANCH X)))
		      (LESSP (IF-COMPLEXITY (LEFT-BRANCH (TEST X)))
			     (IF-COMPLEXITY (TEST X)))
		      (IF-EXPRP X))
		 (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
			(IF-COMPLEXITY X))),

  which we simplify, appealing to the lemmas COMMUTATIVITY-OF-TIMES
  and DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, and expanding the function
  IF-COMPLEXITY, to:

        (IMPLIES (AND (NOT (IF-EXPRP (RIGHT-BRANCH X)))
		      (NOT (IF-EXPRP (LEFT-BRANCH X)))
		      (LESSP (IF-COMPLEXITY (LEFT-BRANCH (TEST X)))
			     (IF-COMPLEXITY (TEST X)))
		      (IF-EXPRP X))
		 (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
			(PLUS (TIMES (IF-COMPLEXITY (LEFT-BRANCH X))
				     (IF-COMPLEXITY (TEST X)))
			      (TIMES (IF-COMPLEXITY (RIGHT-BRANCH X))
				     (IF-COMPLEXITY (TEST X)))))),

  which we again simplify, using linear arithmetic and appealing to
  the lemmas LESSP-TIMES-1, IF-COMPLEXITY-NOT-0, and LESSP-TIMES-2,
  to:

        T.

Case 3. (IMPLIES
	    (AND (LESSP (IF-COMPLEXITY (LEFT-BRANCH (RIGHT-BRANCH X)))
			(IF-COMPLEXITY (RIGHT-BRANCH X)))
		 (NOT (IF-EXPRP (LEFT-BRANCH X)))
		 (LESSP (IF-COMPLEXITY (LEFT-BRANCH (TEST X)))
			(IF-COMPLEXITY (TEST X)))
		 (IF-EXPRP X))
	    (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
		   (IF-COMPLEXITY X))),

  which simplifies, applying COMMUTATIVITY-OF-TIMES and
  DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, and opening up the definition of
  IF-COMPLEXITY, to the new conjecture:

        (IMPLIES
	    (AND (LESSP (IF-COMPLEXITY (LEFT-BRANCH (RIGHT-BRANCH X)))
			(IF-COMPLEXITY (RIGHT-BRANCH X)))
		 (NOT (IF-EXPRP (LEFT-BRANCH X)))
		 (LESSP (IF-COMPLEXITY (LEFT-BRANCH (TEST X)))
			(IF-COMPLEXITY (TEST X)))
		 (IF-EXPRP X))
	    (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
		   (PLUS (TIMES (IF-COMPLEXITY (LEFT-BRANCH X))
				(IF-COMPLEXITY (TEST X)))
			 (TIMES (IF-COMPLEXITY (RIGHT-BRANCH X))
				(IF-COMPLEXITY (TEST X)))))).

  However this again simplifies, using linear arithmetic and applying
  LESSP-TIMES-2, to:

        T.

Case 2. (IMPLIES
	     (AND (NOT (IF-EXPRP (RIGHT-BRANCH X)))
		  (LESSP (IF-COMPLEXITY (LEFT-BRANCH (LEFT-BRANCH X)))
			 (IF-COMPLEXITY (LEFT-BRANCH X)))
		  (LESSP (IF-COMPLEXITY (LEFT-BRANCH (TEST X)))
			 (IF-COMPLEXITY (TEST X)))
		  (IF-EXPRP X))
	     (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
		    (IF-COMPLEXITY X))),

  which simplifies, applying COMMUTATIVITY-OF-TIMES and
  DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, and opening up the definition of
  IF-COMPLEXITY, to:

        (IMPLIES
	     (AND (NOT (IF-EXPRP (RIGHT-BRANCH X)))
		  (LESSP (IF-COMPLEXITY (LEFT-BRANCH (LEFT-BRANCH X)))
			 (IF-COMPLEXITY (LEFT-BRANCH X)))
		  (LESSP (IF-COMPLEXITY (LEFT-BRANCH (TEST X)))
			 (IF-COMPLEXITY (TEST X)))
		  (IF-EXPRP X))
	     (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
		    (PLUS (TIMES (IF-COMPLEXITY (LEFT-BRANCH X))
				 (IF-COMPLEXITY (TEST X)))
			  (TIMES (IF-COMPLEXITY (RIGHT-BRANCH X))
				 (IF-COMPLEXITY (TEST X)))))),

  which we again simplify, using linear arithmetic and applying
  LESSP-TIMES-1, IF-COMPLEXITY-NOT-0, and LESSP-TIMES-2, to:

        T.

Case 1. (IMPLIES
	    (AND (LESSP (IF-COMPLEXITY (LEFT-BRANCH (RIGHT-BRANCH X)))
			(IF-COMPLEXITY (RIGHT-BRANCH X)))
		 (LESSP (IF-COMPLEXITY (LEFT-BRANCH (LEFT-BRANCH X)))
			(IF-COMPLEXITY (LEFT-BRANCH X)))
		 (LESSP (IF-COMPLEXITY (LEFT-BRANCH (TEST X)))
			(IF-COMPLEXITY (TEST X)))
		 (IF-EXPRP X))
	    (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
		   (IF-COMPLEXITY X))).

  This simplifies, rewriting with the lemmas COMMUTATIVITY-OF-TIMES
  and DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, and expanding the definition
  of IF-COMPLEXITY, to:

        (IMPLIES
	    (AND (LESSP (IF-COMPLEXITY (LEFT-BRANCH (RIGHT-BRANCH X)))
			(IF-COMPLEXITY (RIGHT-BRANCH X)))
		 (LESSP (IF-COMPLEXITY (LEFT-BRANCH (LEFT-BRANCH X)))
			(IF-COMPLEXITY (LEFT-BRANCH X)))
		 (LESSP (IF-COMPLEXITY (LEFT-BRANCH (TEST X)))
			(IF-COMPLEXITY (TEST X)))
		 (IF-EXPRP X))
	    (LESSP (IF-COMPLEXITY (LEFT-BRANCH X))
		   (PLUS (TIMES (IF-COMPLEXITY (LEFT-BRANCH X))
				(IF-COMPLEXITY (TEST X)))
			 (TIMES (IF-COMPLEXITY (RIGHT-BRANCH X))
				(IF-COMPLEXITY (TEST X)))))).

  This simplifies again, using linear arithmetic and rewriting with
  the lemma LESSP-TIMES-2, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 13.8800212 1.03898112 ]

IF-COMPLEXITY-GOES-DOWN1 


(PROVE-LEMMA IF-COMPLEXITY-GOES-DOWN2
	     (REWRITE)
	     (IMPLIES (IF-EXPRP X)
		      (LESSP (IF-COMPLEXITY (RIGHT-BRANCH X))
			     (IF-COMPLEXITY X))))
.

Appealing to the lemma TEST-LEFT-BRANCH-RIGHT-BRANCH-ELIM, replace X
by (CONS-IF W V Z) to eliminate (RIGHT-BRANCH X), (LEFT-BRANCH X),
and (TEST X).  This produces:

      (LESSP (IF-COMPLEXITY Z)
	     (IF-COMPLEXITY (CONS-IF W V Z))).

This simplifies, applying DISTRIBUTIVITY-OF-TIMES-OVER-PLUS,
COMMUTATIVITY-OF-TIMES, RIGHT-BRANCH-CONS-IF, LEFT-BRANCH-CONS-IF,
and TEST-CONS-IF, and unfolding the function IF-COMPLEXITY, to the
new formula:

      (LESSP (IF-COMPLEXITY Z)
	     (PLUS (TIMES (IF-COMPLEXITY V)
			  (IF-COMPLEXITY W))
		   (TIMES (IF-COMPLEXITY W)
			  (IF-COMPLEXITY Z)))),

which we would usually push and work on later by induction.  But if
we must use induction to prove the input conjecture, we prefer to
induct on the original formulation of the problem.  Thus we will
disregard all that we have previously done, give the name *1 to the
original input, and work on it.


     So now let us consider:

(IMPLIES (IF-EXPRP X)
	 (LESSP (IF-COMPLEXITY (RIGHT-BRANCH X))
		(IF-COMPLEXITY X))).

We gave this the name *1 above.  We will try to prove it by induction.
There is only one plausible induction.  We will induct according to
the following scheme:
      (AND (IMPLIES (AND (IF-EXPRP X)
			 (P (RIGHT-BRANCH X))
			 (P (LEFT-BRANCH X))
			 (P (TEST X)))
		    (P X))
	   (IMPLIES (NOT (IF-EXPRP X)) (P X))).
Linear arithmetic and the lemmas RIGHT-BRANCH-LESSP,
LEFT-BRANCH-LESSP, and TEST-LESSP inform us that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme leads
to eight new goals:

Case 8. (IMPLIES (AND (NOT (IF-EXPRP (RIGHT-BRANCH X)))
		      (NOT (IF-EXPRP (LEFT-BRANCH X)))
		      (NOT (IF-EXPRP (TEST X)))
		      (IF-EXPRP X))
		 (LESSP (IF-COMPLEXITY (RIGHT-BRANCH X))
			(IF-COMPLEXITY X))).

  This simplifies, appealing to the lemmas COMMUTATIVITY-OF-TIMES and
  DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, and opening up IF-COMPLEXITY, to:

        (IMPLIES (AND (NOT (IF-EXPRP (RIGHT-BRANCH X)))
		      (NOT (IF-EXPRP (LEFT-BRANCH X)))
		      (NOT (IF-EXPRP (TEST X)))
		      (IF-EXPRP X))
		 (LESSP (IF-COMPLEXITY (RIGHT-BRANCH X))
			(PLUS (TIMES (IF-COMPLEXITY (LEFT-BRANCH X))
				     (IF-COMPLEXITY (TEST X)))
			      (TIMES (IF-COMPLEXITY (RIGHT-BRANCH X))
				     (IF-COMPLEXITY (TEST X)))))),

  which we further simplify, unfolding the functions IF-COMPLEXITY,
  TIMES, PLUS, and LESSP, to:

        T.

Case 7. (IMPLIES
	   (AND (LESSP (IF-COMPLEXITY (RIGHT-BRANCH (RIGHT-BRANCH X)))
		       (IF-COMPLEXITY (RIGHT-BRANCH X)))
		(NOT (IF-EXPRP (LEFT-BRANCH X)))
		(NOT (IF-EXPRP (TEST X)))
		(IF-EXPRP X))
	   (LESSP (IF-COMPLEXITY (RIGHT-BRANCH X))
		  (IF-COMPLEXITY X))),

  which we simplify, applying COMMUTATIVITY-OF-TIMES and
  DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, and expanding the definition of
  IF-COMPLEXITY, to the new formula:

        (IMPLIES
	   (AND (LESSP (IF-COMPLEXITY (RIGHT-BRANCH (RIGHT-BRANCH X)))
		       (IF-COMPLEXITY (RIGHT-BRANCH X)))
		(NOT (IF-EXPRP (LEFT-BRANCH X)))
		(NOT (IF-EXPRP (TEST X)))
		(IF-EXPRP X))
	   (LESSP (IF-COMPLEXITY (RIGHT-BRANCH X))
		  (PLUS (TIMES (IF-COMPLEXITY (LEFT-BRANCH X))
			       (IF-COMPLEXITY (TEST X)))
			(TIMES (IF-COMPLEXITY (RIGHT-BRANCH X))
			       (IF-COMPLEXITY (TEST X)))))).

  This further simplifies, rewriting with COMMUTATIVITY-OF-TIMES, and
  expanding the definitions of IF-COMPLEXITY and TIMES, to the new
  conjecture:

        (IMPLIES
	   (AND (LESSP (IF-COMPLEXITY (RIGHT-BRANCH (RIGHT-BRANCH X)))
		       (IF-COMPLEXITY (RIGHT-BRANCH X)))
		(NOT (IF-EXPRP (LEFT-BRANCH X)))
		(NOT (IF-EXPRP (TEST X)))
		(IF-EXPRP X))
	   (LESSP (IF-COMPLEXITY (RIGHT-BRANCH X))
		  (PLUS 1
			(TIMES 1
			       (IF-COMPLEXITY (RIGHT-BRANCH X)))))),

  which we again simplify, using linear arithmetic, to:

        T.

Case 6. (IMPLIES
	    (AND (NOT (IF-EXPRP (RIGHT-BRANCH X)))
		 (LESSP (IF-COMPLEXITY (RIGHT-BRANCH (LEFT-BRANCH X)))
			(IF-COMPLEXITY (LEFT-BRANCH X)))
		 (NOT (IF-EXPRP (TEST X)))
		 (IF-EXPRP X))
	    (LESSP (IF-COMPLEXITY (RIGHT-BRANCH X))
		   (IF-COMPLEXITY X))).

  This simplifies, applying the lemmas COMMUTATIVITY-OF-TIMES and
  DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, and unfolding IF-COMPLEXITY, to
  the conjecture:

        (IMPLIES
	    (AND (NOT (IF-EXPRP (RIGHT-BRANCH X)))
		 (LESSP (IF-COMPLEXITY (RIGHT-BRANCH (LEFT-BRANCH X)))
			(IF-COMPLEXITY (LEFT-BRANCH X)))
		 (NOT (IF-EXPRP (TEST X)))
		 (IF-EXPRP X))
	    (LESSP (IF-COMPLEXITY (RIGHT-BRANCH X))
		   (PLUS (TIMES (IF-COMPLEXITY (LEFT-BRANCH X))
				(IF-COMPLEXITY (TEST X)))
			 (TIMES (IF-COMPLEXITY (RIGHT-BRANCH X))
				(IF-COMPLEXITY (TEST X)))))),

  which again simplifies, using linear arithmetic and rewriting with
  LESSP-TIMES-2 and IF-COMPLEXITY-NOT-0, to:

        T.

Case 5. (IMPLIES
	   (AND (LESSP (IF-COMPLEXITY (RIGHT-BRANCH (RIGHT-BRANCH X)))
		       (IF-COMPLEXITY (RIGHT-BRANCH X)))
		(LESSP (IF-COMPLEXITY (RIGHT-BRANCH (LEFT-BRANCH X)))
		       (IF-COMPLEXITY (LEFT-BRANCH X)))
		(NOT (IF-EXPRP (TEST X)))
		(IF-EXPRP X))
	   (LESSP (IF-COMPLEXITY (RIGHT-BRANCH X))
		  (IF-COMPLEXITY X))).

  This simplifies, applying the lemmas COMMUTATIVITY-OF-TIMES and
  DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, and opening up the function
  IF-COMPLEXITY, to:

        (IMPLIES
	   (AND (LESSP (IF-COMPLEXITY (RIGHT-BRANCH (RIGHT-BRANCH X)))
		       (IF-COMPLEXITY (RIGHT-BRANCH X)))
		(LESSP (IF-COMPLEXITY (RIGHT-BRANCH (LEFT-BRANCH X)))
		       (IF-COMPLEXITY (LEFT-BRANCH X)))
		(NOT (IF-EXPRP (TEST X)))
		(IF-EXPRP X))
	   (LESSP (IF-COMPLEXITY (RIGHT-BRANCH X))
		  (PLUS (TIMES (IF-COMPLEXITY (LEFT-BRANCH X))
			       (IF-COMPLEXITY (TEST X)))
			(TIMES (IF-COMPLEXITY (RIGHT-BRANCH X))
			       (IF-COMPLEXITY (TEST X)))))),

  which we again simplify, using linear arithmetic and applying the
  lemmas LESSP-TIMES-2 and IF-COMPLEXITY-NOT-0, to:

        T.

Case 4. (IMPLIES (AND (NOT (IF-EXPRP (RIGHT-BRANCH X)))
		      (NOT (IF-EXPRP (LEFT-BRANCH X)))
		      (LESSP (IF-COMPLEXITY (RIGHT-BRANCH (TEST X)))
			     (IF-COMPLEXITY (TEST X)))
		      (IF-EXPRP X))
		 (LESSP (IF-COMPLEXITY (RIGHT-BRANCH X))
			(IF-COMPLEXITY X))),

  which we simplify, applying COMMUTATIVITY-OF-TIMES and
  DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, and opening up the definition of
  IF-COMPLEXITY, to the new conjecture:

        (IMPLIES (AND (NOT (IF-EXPRP (RIGHT-BRANCH X)))
		      (NOT (IF-EXPRP (LEFT-BRANCH X)))
		      (LESSP (IF-COMPLEXITY (RIGHT-BRANCH (TEST X)))
			     (IF-COMPLEXITY (TEST X)))
		      (IF-EXPRP X))
		 (LESSP (IF-COMPLEXITY (RIGHT-BRANCH X))
			(PLUS (TIMES (IF-COMPLEXITY (LEFT-BRANCH X))
				     (IF-COMPLEXITY (TEST X)))
			      (TIMES (IF-COMPLEXITY (RIGHT-BRANCH X))
				     (IF-COMPLEXITY (TEST X)))))),

  which we again simplify, using linear arithmetic and applying
  LESSP-TIMES-2, LESSP-TIMES-1, and IF-COMPLEXITY-NOT-0, to:

        T.

Case 3. (IMPLIES
	   (AND (LESSP (IF-COMPLEXITY (RIGHT-BRANCH (RIGHT-BRANCH X)))
		       (IF-COMPLEXITY (RIGHT-BRANCH X)))
		(NOT (IF-EXPRP (LEFT-BRANCH X)))
		(LESSP (IF-COMPLEXITY (RIGHT-BRANCH (TEST X)))
		       (IF-COMPLEXITY (TEST X)))
		(IF-EXPRP X))
	   (LESSP (IF-COMPLEXITY (RIGHT-BRANCH X))
		  (IF-COMPLEXITY X))),

  which we simplify, rewriting with the lemmas COMMUTATIVITY-OF-TIMES
  and DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, and opening up the
  definition of IF-COMPLEXITY, to the goal:

        (IMPLIES
	   (AND (LESSP (IF-COMPLEXITY (RIGHT-BRANCH (RIGHT-BRANCH X)))
		       (IF-COMPLEXITY (RIGHT-BRANCH X)))
		(NOT (IF-EXPRP (LEFT-BRANCH X)))
		(LESSP (IF-COMPLEXITY (RIGHT-BRANCH (TEST X)))
		       (IF-COMPLEXITY (TEST X)))
		(IF-EXPRP X))
	   (LESSP (IF-COMPLEXITY (RIGHT-BRANCH X))
		  (PLUS (TIMES (IF-COMPLEXITY (LEFT-BRANCH X))
			       (IF-COMPLEXITY (TEST X)))
			(TIMES (IF-COMPLEXITY (RIGHT-BRANCH X))
			       (IF-COMPLEXITY (TEST X)))))),

  which again simplifies, using linear arithmetic and applying
  LESSP-TIMES-2, LESSP-TIMES-1, and IF-COMPLEXITY-NOT-0, to:

        T.

Case 2. (IMPLIES
	    (AND (NOT (IF-EXPRP (RIGHT-BRANCH X)))
		 (LESSP (IF-COMPLEXITY (RIGHT-BRANCH (LEFT-BRANCH X)))
			(IF-COMPLEXITY (LEFT-BRANCH X)))
		 (LESSP (IF-COMPLEXITY (RIGHT-BRANCH (TEST X)))
			(IF-COMPLEXITY (TEST X)))
		 (IF-EXPRP X))
	    (LESSP (IF-COMPLEXITY (RIGHT-BRANCH X))
		   (IF-COMPLEXITY X))).

  This simplifies, applying COMMUTATIVITY-OF-TIMES and
  DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, and opening up IF-COMPLEXITY, to:

        (IMPLIES
	    (AND (NOT (IF-EXPRP (RIGHT-BRANCH X)))
		 (LESSP (IF-COMPLEXITY (RIGHT-BRANCH (LEFT-BRANCH X)))
			(IF-COMPLEXITY (LEFT-BRANCH X)))
		 (LESSP (IF-COMPLEXITY (RIGHT-BRANCH (TEST X)))
			(IF-COMPLEXITY (TEST X)))
		 (IF-EXPRP X))
	    (LESSP (IF-COMPLEXITY (RIGHT-BRANCH X))
		   (PLUS (TIMES (IF-COMPLEXITY (LEFT-BRANCH X))
				(IF-COMPLEXITY (TEST X)))
			 (TIMES (IF-COMPLEXITY (RIGHT-BRANCH X))
				(IF-COMPLEXITY (TEST X)))))).

  This simplifies again, using linear arithmetic and applying the
  lemmas LESSP-TIMES-2 and LESSP-TIMES-1, to:

        T.

Case 1. (IMPLIES
	   (AND (LESSP (IF-COMPLEXITY (RIGHT-BRANCH (RIGHT-BRANCH X)))
		       (IF-COMPLEXITY (RIGHT-BRANCH X)))
		(LESSP (IF-COMPLEXITY (RIGHT-BRANCH (LEFT-BRANCH X)))
		       (IF-COMPLEXITY (LEFT-BRANCH X)))
		(LESSP (IF-COMPLEXITY (RIGHT-BRANCH (TEST X)))
		       (IF-COMPLEXITY (TEST X)))
		(IF-EXPRP X))
	   (LESSP (IF-COMPLEXITY (RIGHT-BRANCH X))
		  (IF-COMPLEXITY X))).

  This simplifies, appealing to the lemmas COMMUTATIVITY-OF-TIMES and
  DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, and unfolding the definition of
  IF-COMPLEXITY, to:

        (IMPLIES
	   (AND (LESSP (IF-COMPLEXITY (RIGHT-BRANCH (RIGHT-BRANCH X)))
		       (IF-COMPLEXITY (RIGHT-BRANCH X)))
		(LESSP (IF-COMPLEXITY (RIGHT-BRANCH (LEFT-BRANCH X)))
		       (IF-COMPLEXITY (LEFT-BRANCH X)))
		(LESSP (IF-COMPLEXITY (RIGHT-BRANCH (TEST X)))
		       (IF-COMPLEXITY (TEST X)))
		(IF-EXPRP X))
	   (LESSP (IF-COMPLEXITY (RIGHT-BRANCH X))
		  (PLUS (TIMES (IF-COMPLEXITY (LEFT-BRANCH X))
			       (IF-COMPLEXITY (TEST X)))
			(TIMES (IF-COMPLEXITY (RIGHT-BRANCH X))
			       (IF-COMPLEXITY (TEST X)))))),

  which again simplifies, using linear arithmetic and applying
  LESSP-TIMES-2 and LESSP-TIMES-1, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 17.6520102 0.97098795 ]

IF-COMPLEXITY-GOES-DOWN2 


(DEFN NORMALIZE
      (X)
      (IF (IF-EXPRP X)
	  (IF (IF-EXPRP (TEST X))
	      (NORMALIZE (CONS-IF (TEST (TEST X))
				  (CONS-IF (LEFT-BRANCH (TEST X))
					   (LEFT-BRANCH X)
					   (RIGHT-BRANCH X))
				  (CONS-IF (RIGHT-BRANCH (TEST X))
					   (LEFT-BRANCH X)
					   (RIGHT-BRANCH X))))
	      (CONS-IF (TEST X)
		       (NORMALIZE (LEFT-BRANCH X))
		       (NORMALIZE (RIGHT-BRANCH X))))
	  X)
      ((LEX2 (LIST (IF-COMPLEXITY X)
		   (IF-DEPTH X)))))
     Linear arithmetic, the lemmas CAR-CONS, IF-COMPLEXITY-NOT-0,
EQUAL-TIMES-0, LESSP-TIMES-CANCELLATION, LESSP-PLUS-CANCELATION,
CDR-CONS, SUB1-ADD1, ASSOCIATIVITY-OF-PLUS, COMMUTATIVITY2-OF-PLUS,
COMMUTATIVITY2-OF-TIMES, COMMUTATIVITY-OF-TIMES, TEST-CONS-IF,
LEFT-BRANCH-CONS-IF, RIGHT-BRANCH-CONS-IF,
DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, IF-COMPLEXITY-GOES-DOWN2, and
IF-COMPLEXITY-GOES-DOWN1, and the definitions of LEX2, LESSP,
IF-DEPTH, IF-COMPLEXITY, CAR, CONS, and ADD1 inform us that the
measure (LIST (IF-COMPLEXITY X) (IF-DEPTH X)) decreases according to
the well-founded relation LEX2 in each recursive call.  Hence,
NORMALIZE is accepted under the principle of definition.  Observe
that (OR (IF-EXPRP (NORMALIZE X)) (EQUAL (NORMALIZE X) X)) is a
theorem.




[ 9.0889974 0.083992513 ]

NORMALIZE 


(DEFN NORMALIZED-IF-EXPRP
      (X)
      (IF (IF-EXPRP X)
	  (AND (NOT (IF-EXPRP (TEST X)))
	       (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
	       (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X)))
	  T))
     Linear arithmetic and the lemmas RIGHT-BRANCH-LESSP and
LEFT-BRANCH-LESSP establish that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, NORMALIZED-IF-EXPRP is accepted under the principle of
definition.  Observe that:
      (OR (FALSEP (NORMALIZED-IF-EXPRP X))
	  (TRUEP (NORMALIZED-IF-EXPRP X)))
is a theorem.




[ 0.131998697 0.047998047 ]

NORMALIZED-IF-EXPRP 


(DEFN ASSIGNEDP
      (VAR ALIST)
      (IF (EQUAL VAR T)
	  T
	  (IF (EQUAL VAR F)
	      T
	      (IF (NLISTP ALIST)
		  F
		  (IF (EQUAL VAR (CAAR ALIST))
		      T
		      (ASSIGNEDP VAR (CDR ALIST)))))))
     Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP establish that the measure (COUNT ALIST)
decreases according to the well-founded relation LESSP in each
recursive call.  Hence, ASSIGNEDP is accepted under the principle of
definition.  Observe that:
      (OR (FALSEP (ASSIGNEDP VAR ALIST))
	  (TRUEP (ASSIGNEDP VAR ALIST)))
is a theorem.




[ 0.486995444 0.052001953 ]

ASSIGNEDP 


(DEFN ASSUME-TRUE
      (VAR ALIST)
      (CONS (CONS VAR T) ALIST))
     Note that (LISTP (ASSUME-TRUE VAR ALIST)) is a theorem.




[ 0.0279947917 0.0110026042 ]

ASSUME-TRUE 


(DEFN ASSUME-FALSE
      (VAR ALIST)
      (CONS (CONS VAR F) ALIST))
     Note that (LISTP (ASSUME-FALSE VAR ALIST)) is a theorem.




[ 0.0289957682 0.0100016276 ]

ASSUME-FALSE 


(DEFN TAUTOLOGYP
      (X ALIST)
      (IF (IF-EXPRP X)
	  (IF (ASSIGNEDP (TEST X) ALIST)
	      (IF (ASSIGNMENT (TEST X) ALIST)
		  (TAUTOLOGYP (LEFT-BRANCH X) ALIST)
		  (TAUTOLOGYP (RIGHT-BRANCH X) ALIST))
	      (AND (TAUTOLOGYP (LEFT-BRANCH X)
			       (ASSUME-TRUE (TEST X) ALIST))
		   (TAUTOLOGYP (RIGHT-BRANCH X)
			       (ASSUME-FALSE (TEST X) ALIST))))
	  (ASSIGNMENT X ALIST)))
     Linear arithmetic and the lemmas LEFT-BRANCH-LESSP and
RIGHT-BRANCH-LESSP inform us that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, TAUTOLOGYP is accepted under the principle of definition.




[ 0.283992514 0.0350097655 ]

TAUTOLOGYP 


(PROVE-LEMMA ASSIGNMENT-APPEND
	     (REWRITE)
	     (EQUAL (ASSIGNMENT X (APPEND A B))
		    (IF (ASSIGNEDP X A)
			(ASSIGNMENT X A)
			(ASSIGNMENT X B))))
This simplifies, trivially, to two new conjectures:

Case 2. (IMPLIES (NOT (ASSIGNEDP X A))
		 (EQUAL (ASSIGNMENT X (APPEND A B))
			(ASSIGNMENT X B))).

  Call the above conjecture *1.

Case 1. (IMPLIES (ASSIGNEDP X A)
		 (EQUAL (ASSIGNMENT X (APPEND A B))
			(ASSIGNMENT X A))),

  which we would usually push and work on later by induction.  But if
  we must use induction to prove the input conjecture, we prefer to
  induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us return to:

(EQUAL (ASSIGNMENT X (APPEND A B))
       (IF (ASSIGNEDP X A)
	   (ASSIGNMENT X A)
	   (ASSIGNMENT X B))),

named *1 above.  Perhaps we can prove it by induction.  The recursive
terms in the conjecture suggest four inductions.  They merge into two
likely candidate inductions.  However, only one is unflawed.  We will
induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP A) (P X (CDR A) B))
		    (P X A B))
	   (IMPLIES (NOT (LISTP A)) (P X A B))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT A) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
produces two new formulas:

Case 2. (IMPLIES (AND (LISTP A)
		      (EQUAL (ASSIGNMENT X (APPEND (CDR A) B))
			     (IF (ASSIGNEDP X (CDR A))
				 (ASSIGNMENT X (CDR A))
				 (ASSIGNMENT X B))))
		 (EQUAL (ASSIGNMENT X (APPEND A B))
			(IF (ASSIGNEDP X A)
			    (ASSIGNMENT X A)
			    (ASSIGNMENT X B)))).

  This simplifies, applying the lemmas CDR-CONS and CAR-CONS, and
  expanding the definitions of APPEND, ASSIGNMENT, and ASSIGNEDP, to:

        T.

Case 1. (IMPLIES (NOT (LISTP A))
		 (EQUAL (ASSIGNMENT X (APPEND A B))
			(IF (ASSIGNEDP X A)
			    (ASSIGNMENT X A)
			    (ASSIGNMENT X B)))),

  which simplifies, unfolding the functions APPEND, ASSIGNEDP, and
  ASSIGNMENT, to the following two new formulas:

  Case 1.2.
          (IMPLIES (AND (NOT (LISTP A)) (NOT X))
		   (EQUAL (ASSIGNMENT X B)
			  (EQUAL X T))).

    But this again simplifies, unfolding the definitions of EQUAL and
    ASSIGNMENT, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NOT (LISTP A)) (EQUAL X T))
		   (EQUAL (ASSIGNMENT X B)
			  (EQUAL X T))),

    which we again simplify, unfolding the functions EQUAL and
    ASSIGNMENT, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 2.6430013 0.32199707 ]

ASSIGNMENT-APPEND 


(PROVE-LEMMA VALUE-CAN-IGNORE-REDUNDANT-ASSIGNMENTS
	     (REWRITE)
	     (AND (IMPLIES (AND (IFF VAL (ASSIGNMENT VAR A))
				(VALUE X A))
			   (VALUE X (CONS (CONS VAR VAL) A)))
		  (IMPLIES (AND (IFF VAL (ASSIGNMENT VAR A))
				(NOT (VALUE X A)))
			   (NOT (VALUE X (CONS (CONS VAR VAL) A))))))
This formula can be simplified, using the abbreviations NOT, IMPLIES,
and AND, to the following two new goals:

Case 2. (IMPLIES (AND (IFF VAL (ASSIGNMENT VAR A))
		      (VALUE X A))
		 (VALUE X (CONS (CONS VAR VAL) A))).

  This simplifies, unfolding IFF, to the following two new
  conjectures:

  Case 2.2.
          (IMPLIES (AND (NOT VAL)
			(NOT (ASSIGNMENT VAR A))
			(VALUE X A))
		   (VALUE X (CONS (CONS VAR F) A))),

    which again simplifies, obviously, to the new conjecture:

          (IMPLIES (AND (NOT (ASSIGNMENT VAR A))
			(VALUE X A))
		   (VALUE X (CONS (CONS VAR F) A))).

    Call the above conjecture *1.

  Case 2.1.
          (IMPLIES (AND VAL
			(ASSIGNMENT VAR A)
			(VALUE X A))
		   (VALUE X (CONS (CONS VAR VAL) A))),

    which we would normally push and work on later by induction.  But
    if we must use induction to prove the input conjecture, we prefer
    to induct on the original formulation of the problem.  Thus we
    will disregard all that we have previously done, give the name *1
    to the original input, and work on it.


     So now let us return to:

(AND (IMPLIES (AND (IFF VAL (ASSIGNMENT VAR A))
		   (VALUE X A))
	      (VALUE X (CONS (CONS VAR VAL) A)))
     (IMPLIES (AND (IFF VAL (ASSIGNMENT VAR A))
		   (NOT (VALUE X A)))
	      (NOT (VALUE X (CONS (CONS VAR VAL) A))))).

We named this *1 above.  Let us appeal to the induction principle.
There are six plausible inductions.  They merge into two likely
candidate inductions.  However, only one is unflawed.  We will induct
according to the following scheme:
      (AND (IMPLIES (AND (IF-EXPRP X)
			 (VALUE (TEST X) A)
			 (P (TEST X) VAR VAL A)
			 (P (LEFT-BRANCH X) VAR VAL A))
		    (P X VAR VAL A))
	   (IMPLIES (AND (IF-EXPRP X)
			 (NOT (VALUE (TEST X) A))
			 (P (TEST X) VAR VAL A)
			 (P (RIGHT-BRANCH X) VAR VAL A))
		    (P X VAR VAL A))
	   (IMPLIES (NOT (IF-EXPRP X))
		    (P X VAR VAL A))).
Linear arithmetic and the lemmas TEST-LESSP, LEFT-BRANCH-LESSP, and
RIGHT-BRANCH-LESSP can be used to establish that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
produces the following ten new formulas:

Case 10.(IMPLIES (AND (IF-EXPRP X)
		      (VALUE (TEST X)
			     (CONS (CONS VAR VAL) A))
		      (VALUE (LEFT-BRANCH X)
			     (CONS (CONS VAR VAL) A))
		      (VALUE (TEST X) A)
		      (VALUE (LEFT-BRANCH X) A)
		      (IFF VAL (ASSIGNMENT VAR A))
		      (VALUE X A))
		 (VALUE X (CONS (CONS VAR VAL) A))).

  This simplifies, opening up IFF and VALUE, to:

        (IMPLIES (AND (IF-EXPRP X)
		      (VALUE (TEST X)
			     (CONS (CONS VAR VAL) A))
		      (VALUE (LEFT-BRANCH X)
			     (CONS (CONS VAR VAL) A))
		      (VALUE (TEST X) A)
		      (VALUE (LEFT-BRANCH X) A)
		      (NOT VAL)
		      (NOT (ASSIGNMENT VAR A)))
		 (VALUE X (CONS (CONS VAR F) A))),

  which we again simplify, unfolding the function VALUE, to:

        T.

Case 9. (IMPLIES (AND (IF-EXPRP X)
		      (VALUE (TEST X)
			     (CONS (CONS VAR VAL) A))
		      (NOT (VALUE (LEFT-BRANCH X) A))
		      (VALUE (TEST X) A)
		      (NOT (VALUE (LEFT-BRANCH X)
				  (CONS (CONS VAR VAL) A)))
		      (IFF VAL (ASSIGNMENT VAR A))
		      (VALUE X A))
		 (VALUE X (CONS (CONS VAR VAL) A))),

  which we simplify, expanding the definitions of IFF and VALUE, to:

        T.

Case 8. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) A))
		      (VALUE (RIGHT-BRANCH X)
			     (CONS (CONS VAR VAL) A))
		      (NOT (VALUE (TEST X)
				  (CONS (CONS VAR VAL) A)))
		      (VALUE (RIGHT-BRANCH X) A)
		      (IFF VAL (ASSIGNMENT VAR A))
		      (VALUE X A))
		 (VALUE X (CONS (CONS VAR VAL) A))),

  which we simplify, unfolding IFF and VALUE, to:

        (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) A))
		      (VALUE (RIGHT-BRANCH X)
			     (CONS (CONS VAR VAL) A))
		      (NOT (VALUE (TEST X)
				  (CONS (CONS VAR VAL) A)))
		      (VALUE (RIGHT-BRANCH X) A)
		      (NOT VAL)
		      (NOT (ASSIGNMENT VAR A)))
		 (VALUE X (CONS (CONS VAR F) A))),

  which again simplifies, unfolding the definition of VALUE, to:

        T.

Case 7. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) A))
		      (NOT (VALUE (RIGHT-BRANCH X) A))
		      (NOT (VALUE (TEST X)
				  (CONS (CONS VAR VAL) A)))
		      (NOT (VALUE (RIGHT-BRANCH X)
				  (CONS (CONS VAR VAL) A)))
		      (IFF VAL (ASSIGNMENT VAR A))
		      (VALUE X A))
		 (VALUE X (CONS (CONS VAR VAL) A))).

  This simplifies, unfolding the definitions of IFF and VALUE, to:

        T.

Case 6. (IMPLIES (AND (NOT (IF-EXPRP X))
		      (IFF VAL (ASSIGNMENT VAR A))
		      (VALUE X A))
		 (VALUE X (CONS (CONS VAR VAL) A))),

  which we simplify, rewriting with CAR-CONS and CDR-CONS, and
  expanding the functions IFF, VALUE, and ASSIGNMENT, to the
  following three new formulas:

  Case 6.3.
          (IMPLIES (AND (NOT (IF-EXPRP X))
			(NOT VAL)
			(NOT (ASSIGNMENT VAR A))
			(ASSIGNMENT X A)
			(NOT (EQUAL X T)))
		   (NOT (EQUAL X VAR))),

    which we again simplify, obviously, to:

          T.

  Case 6.2.
          (IMPLIES (AND (NOT (IF-EXPRP X))
			(NOT VAL)
			(NOT (ASSIGNMENT VAR A))
			(ASSIGNMENT X A)
			(NOT (EQUAL X T)))
		   X),

    which we again simplify, opening up IF-EXPRP, EQUAL, and
    ASSIGNMENT, to:

          T.

  Case 6.1.
          (IMPLIES (AND (NOT (IF-EXPRP X))
			VAL
			(ASSIGNMENT VAR A)
			(ASSIGNMENT X A)
			(NOT (EQUAL X T)))
		   X).

    This again simplifies, expanding the functions IF-EXPRP, EQUAL,
    and ASSIGNMENT, to:

          T.

Case 5. (IMPLIES (AND (IF-EXPRP X)
		      (VALUE (TEST X)
			     (CONS (CONS VAR VAL) A))
		      (VALUE (LEFT-BRANCH X)
			     (CONS (CONS VAR VAL) A))
		      (VALUE (TEST X) A)
		      (VALUE (LEFT-BRANCH X) A)
		      (IFF VAL (ASSIGNMENT VAR A))
		      (NOT (VALUE X A)))
		 (NOT (VALUE X (CONS (CONS VAR VAL) A)))),

  which simplifies, expanding the functions IFF and VALUE, to:

        T.

Case 4. (IMPLIES (AND (IF-EXPRP X)
		      (VALUE (TEST X)
			     (CONS (CONS VAR VAL) A))
		      (NOT (VALUE (LEFT-BRANCH X) A))
		      (VALUE (TEST X) A)
		      (NOT (VALUE (LEFT-BRANCH X)
				  (CONS (CONS VAR VAL) A)))
		      (IFF VAL (ASSIGNMENT VAR A))
		      (NOT (VALUE X A)))
		 (NOT (VALUE X (CONS (CONS VAR VAL) A)))).

  This simplifies, opening up the definitions of IFF and VALUE, to:

        (IMPLIES (AND (IF-EXPRP X)
		      (VALUE (TEST X)
			     (CONS (CONS VAR VAL) A))
		      (NOT (VALUE (LEFT-BRANCH X) A))
		      (VALUE (TEST X) A)
		      (NOT (VALUE (LEFT-BRANCH X)
				  (CONS (CONS VAR VAL) A)))
		      (NOT VAL)
		      (NOT (ASSIGNMENT VAR A)))
		 (NOT (VALUE X (CONS (CONS VAR F) A)))),

  which we again simplify, opening up the function VALUE, to:

        T.

Case 3. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) A))
		      (VALUE (RIGHT-BRANCH X)
			     (CONS (CONS VAR VAL) A))
		      (NOT (VALUE (TEST X)
				  (CONS (CONS VAR VAL) A)))
		      (VALUE (RIGHT-BRANCH X) A)
		      (IFF VAL (ASSIGNMENT VAR A))
		      (NOT (VALUE X A)))
		 (NOT (VALUE X (CONS (CONS VAR VAL) A)))),

  which we simplify, expanding the definitions of IFF and VALUE, to:

        T.

Case 2. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) A))
		      (NOT (VALUE (RIGHT-BRANCH X) A))
		      (NOT (VALUE (TEST X)
				  (CONS (CONS VAR VAL) A)))
		      (NOT (VALUE (RIGHT-BRANCH X)
				  (CONS (CONS VAR VAL) A)))
		      (IFF VAL (ASSIGNMENT VAR A))
		      (NOT (VALUE X A)))
		 (NOT (VALUE X (CONS (CONS VAR VAL) A)))),

  which we simplify, opening up IFF and VALUE, to the goal:

        (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) A))
		      (NOT (VALUE (RIGHT-BRANCH X) A))
		      (NOT (VALUE (TEST X)
				  (CONS (CONS VAR VAL) A)))
		      (NOT (VALUE (RIGHT-BRANCH X)
				  (CONS (CONS VAR VAL) A)))
		      (NOT VAL)
		      (NOT (ASSIGNMENT VAR A)))
		 (NOT (VALUE X (CONS (CONS VAR F) A)))).

  But this simplifies again, expanding the definition of VALUE, to:

        T.

Case 1. (IMPLIES (AND (NOT (IF-EXPRP X))
		      (IFF VAL (ASSIGNMENT VAR A))
		      (NOT (VALUE X A)))
		 (NOT (VALUE X (CONS (CONS VAR VAL) A)))).

  This simplifies, applying CAR-CONS and CDR-CONS, and opening up IFF,
  VALUE, and ASSIGNMENT, to three new goals:

  Case 1.3.
          (IMPLIES (AND (NOT (IF-EXPRP X))
			(NOT VAL)
			(NOT (ASSIGNMENT VAR A))
			(NOT (ASSIGNMENT X A)))
		   (NOT (EQUAL X T))),

    which we again simplify, opening up the definitions of IF-EXPRP,
    EQUAL, and ASSIGNMENT, to:

          T.

  Case 1.2.
          (IMPLIES (AND (NOT (IF-EXPRP X))
			VAL
			(ASSIGNMENT VAR A)
			(NOT (ASSIGNMENT X A)))
		   (NOT (EQUAL X T))).

    But this simplifies again, opening up IF-EXPRP, EQUAL, and
    ASSIGNMENT, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NOT (IF-EXPRP X))
			VAL
			(ASSIGNMENT VAR A)
			(NOT (ASSIGNMENT X A))
			X)
		   (NOT (EQUAL X VAR))).

    This simplifies again, obviously, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 14.5749756 1.0190267 ]

VALUE-CAN-IGNORE-REDUNDANT-ASSIGNMENTS 


(PROVE-LEMMA VALUE-SHORT-CUT
	     (REWRITE)
	     (IMPLIES (AND (IF-EXPRP X)
			   (NORMALIZED-IF-EXPRP X))
		      (EQUAL (VALUE (TEST X) A)
			     (ASSIGNMENT (TEST X) A))))
.

Appealing to the lemma TEST-LEFT-BRANCH-RIGHT-BRANCH-ELIM, we now
replace X by (CONS-IF Z W V) to eliminate (TEST X), (RIGHT-BRANCH X),
and (LEFT-BRANCH X).  The result is the new formula:

      (IMPLIES (NORMALIZED-IF-EXPRP (CONS-IF Z W V))
	       (EQUAL (VALUE Z A) (ASSIGNMENT Z A))).

This simplifies, applying RIGHT-BRANCH-CONS-IF, LEFT-BRANCH-CONS-IF,
and TEST-CONS-IF, and unfolding the functions NORMALIZED-IF-EXPRP and
VALUE, to:

      T.

Q.E.D.


[ 0.363989256 0.061010742 ]

VALUE-SHORT-CUT 


(PROVE-LEMMA ASSIGNMENT-IMPLIES-ASSIGNED
	     (REWRITE)
	     (IMPLIES (ASSIGNMENT X A)
		      (ASSIGNEDP X A)))

     Name the conjecture *1.


     Perhaps we can prove it by induction.  The recursive terms in
the conjecture suggest two inductions.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (EQUAL X T) (P X A))
	   (IMPLIES (AND (NOT (EQUAL X T)) (EQUAL X F))
		    (P X A))
	   (IMPLIES (AND (NOT (EQUAL X T))
			 (NOT (EQUAL X F))
			 (NLISTP A))
		    (P X A))
	   (IMPLIES (AND (NOT (EQUAL X T))
			 (NOT (EQUAL X F))
			 (NOT (NLISTP A))
			 (EQUAL X (CAAR A)))
		    (P X A))
	   (IMPLIES (AND (NOT (EQUAL X T))
			 (NOT (EQUAL X F))
			 (NOT (NLISTP A))
			 (NOT (EQUAL X (CAAR A)))
			 (P X (CDR A)))
		    (P X A))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT A) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme produces six new formulas:

Case 6. (IMPLIES (AND (EQUAL X T) (ASSIGNMENT X A))
		 (ASSIGNEDP X A)).

  This simplifies, opening up the definitions of EQUAL, ASSIGNMENT,
  and ASSIGNEDP, to:

        T.

Case 5. (IMPLIES (AND (NOT (EQUAL X T))
		      (EQUAL X F)
		      (ASSIGNMENT X A))
		 (ASSIGNEDP X A)),

  which we simplify, opening up EQUAL and ASSIGNMENT, to:

        T.

Case 4. (IMPLIES (AND (NOT (EQUAL X T))
		      (NOT (EQUAL X F))
		      (NLISTP A)
		      (ASSIGNMENT X A))
		 (ASSIGNEDP X A)),

  which we simplify, unfolding NLISTP and ASSIGNMENT, to:

        T.

Case 3. (IMPLIES (AND (NOT (EQUAL X T))
		      (NOT (EQUAL X F))
		      (NOT (NLISTP A))
		      (EQUAL X (CAAR A))
		      (ASSIGNMENT X A))
		 (ASSIGNEDP X A)).

  This simplifies, opening up NLISTP, ASSIGNMENT, and ASSIGNEDP, to:

        T.

Case 2. (IMPLIES (AND (NOT (EQUAL X T))
		      (NOT (EQUAL X F))
		      (NOT (NLISTP A))
		      (NOT (EQUAL X (CAAR A)))
		      (NOT (ASSIGNMENT X (CDR A)))
		      (ASSIGNMENT X A))
		 (ASSIGNEDP X A)).

  This simplifies, expanding NLISTP and ASSIGNMENT, to:

        T.

Case 1. (IMPLIES (AND (NOT (EQUAL X T))
		      (NOT (EQUAL X F))
		      (NOT (NLISTP A))
		      (NOT (EQUAL X (CAAR A)))
		      (ASSIGNEDP X (CDR A))
		      (ASSIGNMENT X A))
		 (ASSIGNEDP X A)),

  which we simplify, expanding the definitions of NLISTP, ASSIGNMENT,
  and ASSIGNEDP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.58900554 0.335994467 ]

ASSIGNMENT-IMPLIES-ASSIGNED 


(PROVE-LEMMA TAUTOLOGYP-IS-SOUND
	     (REWRITE)
	     (IMPLIES (AND (NORMALIZED-IF-EXPRP X)
			   (TAUTOLOGYP X A1))
		      (VALUE X (APPEND A1 A2))))

     Call the conjecture *1.


     We will appeal to induction.  Four inductions are suggested by
terms in the conjecture.  They merge into two likely candidate
inductions.  However, only one is unflawed.  We will induct according
to the following scheme:
      (AND (IMPLIES (AND (IF-EXPRP X)
			 (VALUE (TEST X) (APPEND A1 A2))
			 (P (LEFT-BRANCH X)
			    (ASSUME-TRUE (TEST X) A1)
			    A2)
			 (P (LEFT-BRANCH X) A1 A2)
			 (P (TEST X) A1 A2))
		    (P X A1 A2))
	   (IMPLIES (AND (IF-EXPRP X)
			 (NOT (VALUE (TEST X) (APPEND A1 A2)))
			 (P (RIGHT-BRANCH X)
			    (ASSUME-FALSE (TEST X) A1)
			    A2)
			 (P (RIGHT-BRANCH X) A1 A2)
			 (P (TEST X) A1 A2))
		    (P X A1 A2))
	   (IMPLIES (NOT (IF-EXPRP X))
		    (P X A1 A2))).
Linear arithmetic and the lemmas TEST-LESSP, LEFT-BRANCH-LESSP, and
RIGHT-BRANCH-LESSP establish that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  Note, however, the inductive instances chosen for A1.
The above induction scheme generates 16 new goals:

Case 16.(IMPLIES (AND (IF-EXPRP X)
		      (NOT (TAUTOLOGYP (LEFT-BRANCH X)
				       (ASSUME-TRUE (TEST X) A1)))
		      (NOT (TAUTOLOGYP (LEFT-BRANCH X) A1))
		      (VALUE (TEST X) (APPEND A1 A2))
		      (NORMALIZED-IF-EXPRP X)
		      (TAUTOLOGYP X A1))
		 (VALUE X (APPEND A1 A2))),

  which we simplify, unfolding NORMALIZED-IF-EXPRP, TAUTOLOGYP, and
  VALUE, to:

        (IMPLIES (AND (IF-EXPRP X)
		      (NOT (TAUTOLOGYP (LEFT-BRANCH X)
				       (ASSUME-TRUE (TEST X) A1)))
		      (NOT (TAUTOLOGYP (LEFT-BRANCH X) A1))
		      (VALUE (TEST X) (APPEND A1 A2))
		      (NOT (IF-EXPRP (TEST X)))
		      (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		      (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		      (ASSIGNEDP (TEST X) A1)
		      (NOT (ASSIGNMENT (TEST X) A1))
		      (TAUTOLOGYP (RIGHT-BRANCH X) A1))
		 (VALUE (LEFT-BRANCH X)
			(APPEND A1 A2))).

  This simplifies further, applying ASSIGNMENT-APPEND and
  VALUE-SHORT-CUT, and opening up ASSUME-TRUE and NORMALIZED-IF-EXPRP,
  to:

        T.

Case 15.(IMPLIES (AND (IF-EXPRP X)
		      (VALUE (LEFT-BRANCH X)
			     (APPEND (ASSUME-TRUE (TEST X) A1) A2))
		      (NOT (TAUTOLOGYP (LEFT-BRANCH X) A1))
		      (VALUE (TEST X) (APPEND A1 A2))
		      (NORMALIZED-IF-EXPRP X)
		      (TAUTOLOGYP X A1))
		 (VALUE X (APPEND A1 A2))),

  which we simplify, unfolding NORMALIZED-IF-EXPRP, TAUTOLOGYP, and
  VALUE, to the following two new goals:

  Case 15.2.
          (IMPLIES (AND (IF-EXPRP X)
			(VALUE (LEFT-BRANCH X)
			       (APPEND (ASSUME-TRUE (TEST X) A1) A2))
			(NOT (TAUTOLOGYP (LEFT-BRANCH X) A1))
			(VALUE (TEST X) (APPEND A1 A2))
			(NOT (IF-EXPRP (TEST X)))
			(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
			(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
			(NOT (ASSIGNEDP (TEST X) A1))
			(TAUTOLOGYP (LEFT-BRANCH X)
				    (ASSUME-TRUE (TEST X) A1))
			(TAUTOLOGYP (RIGHT-BRANCH X)
				    (ASSUME-FALSE (TEST X) A1)))
		   (VALUE (LEFT-BRANCH X)
			  (APPEND A1 A2))).

    However this further simplifies, rewriting with CDR-CONS,
    CAR-CONS, ASSIGNMENT-APPEND, and VALUE-SHORT-CUT, and expanding
    ASSUME-TRUE, APPEND, NORMALIZED-IF-EXPRP, and ASSUME-FALSE, to
    the new conjecture:

          (IMPLIES (AND (IF-EXPRP X)
			(VALUE (LEFT-BRANCH X)
			       (CONS (CONS (TEST X) T)
				     (APPEND A1 A2)))
			(NOT (TAUTOLOGYP (LEFT-BRANCH X) A1))
			(ASSIGNMENT (TEST X) A2)
			(NOT (IF-EXPRP (TEST X)))
			(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
			(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
			(NOT (ASSIGNEDP (TEST X) A1))
			(TAUTOLOGYP (LEFT-BRANCH X)
				    (CONS (CONS (TEST X) T) A1))
			(TAUTOLOGYP (RIGHT-BRANCH X)
				    (CONS (CONS (TEST X) F) A1)))
		   (VALUE (LEFT-BRANCH X)
			  (APPEND A1 A2))).

    This simplifies again, rewriting with the lemmas
    ASSIGNMENT-APPEND and VALUE-CAN-IGNORE-REDUNDANT-ASSIGNMENTS, and
    unfolding IFF, to:

          T.

  Case 15.1.
          (IMPLIES (AND (IF-EXPRP X)
			(VALUE (LEFT-BRANCH X)
			       (APPEND (ASSUME-TRUE (TEST X) A1) A2))
			(NOT (TAUTOLOGYP (LEFT-BRANCH X) A1))
			(VALUE (TEST X) (APPEND A1 A2))
			(NOT (IF-EXPRP (TEST X)))
			(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
			(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
			(ASSIGNEDP (TEST X) A1)
			(NOT (ASSIGNMENT (TEST X) A1))
			(TAUTOLOGYP (RIGHT-BRANCH X) A1))
		   (VALUE (LEFT-BRANCH X)
			  (APPEND A1 A2))),

    which further simplifies, rewriting with CDR-CONS, CAR-CONS,
    ASSIGNMENT-APPEND, and VALUE-SHORT-CUT, and expanding the
    definitions of ASSUME-TRUE, APPEND, and NORMALIZED-IF-EXPRP, to:

          T.

Case 14.(IMPLIES (AND (IF-EXPRP X)
		      (NOT (TAUTOLOGYP (LEFT-BRANCH X)
				       (ASSUME-TRUE (TEST X) A1)))
		      (VALUE (LEFT-BRANCH X) (APPEND A1 A2))
		      (VALUE (TEST X) (APPEND A1 A2))
		      (NORMALIZED-IF-EXPRP X)
		      (TAUTOLOGYP X A1))
		 (VALUE X (APPEND A1 A2))).

  This simplifies, expanding the functions NORMALIZED-IF-EXPRP,
  TAUTOLOGYP, and VALUE, to:

        T.

Case 13.(IMPLIES (AND (IF-EXPRP X)
		      (VALUE (LEFT-BRANCH X)
			     (APPEND (ASSUME-TRUE (TEST X) A1) A2))
		      (VALUE (LEFT-BRANCH X) (APPEND A1 A2))
		      (VALUE (TEST X) (APPEND A1 A2))
		      (NORMALIZED-IF-EXPRP X)
		      (TAUTOLOGYP X A1))
		 (VALUE X (APPEND A1 A2))),

  which simplifies, expanding the functions NORMALIZED-IF-EXPRP,
  TAUTOLOGYP, and VALUE, to:

        T.

Case 12.(IMPLIES (AND (IF-EXPRP X)
		      (NOT (NORMALIZED-IF-EXPRP (LEFT-BRANCH X)))
		      (VALUE (TEST X) (APPEND A1 A2))
		      (NORMALIZED-IF-EXPRP X)
		      (TAUTOLOGYP X A1))
		 (VALUE X (APPEND A1 A2))).

  This simplifies, unfolding the function NORMALIZED-IF-EXPRP, to:

        T.

Case 11.(IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (APPEND A1 A2)))
		      (NOT (TAUTOLOGYP (RIGHT-BRANCH X)
				       (ASSUME-FALSE (TEST X) A1)))
		      (NOT (TAUTOLOGYP (RIGHT-BRANCH X) A1))
		      (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		      (NORMALIZED-IF-EXPRP X)
		      (TAUTOLOGYP X A1))
		 (VALUE X (APPEND A1 A2))).

  This simplifies, expanding the functions NORMALIZED-IF-EXPRP,
  TAUTOLOGYP, and VALUE, to:

        (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (APPEND A1 A2)))
		      (NOT (TAUTOLOGYP (RIGHT-BRANCH X)
				       (ASSUME-FALSE (TEST X) A1)))
		      (NOT (TAUTOLOGYP (RIGHT-BRANCH X) A1))
		      (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		      (NOT (IF-EXPRP (TEST X)))
		      (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		      (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		      (ASSIGNEDP (TEST X) A1)
		      (ASSIGNMENT (TEST X) A1)
		      (TAUTOLOGYP (LEFT-BRANCH X) A1))
		 (VALUE (RIGHT-BRANCH X)
			(APPEND A1 A2))).

  This again simplifies, applying ASSIGNMENT-IMPLIES-ASSIGNED, to the
  new formula:

        (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (APPEND A1 A2)))
		      (NOT (TAUTOLOGYP (RIGHT-BRANCH X)
				       (ASSUME-FALSE (TEST X) A1)))
		      (NOT (TAUTOLOGYP (RIGHT-BRANCH X) A1))
		      (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		      (NOT (IF-EXPRP (TEST X)))
		      (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		      (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		      (ASSIGNMENT (TEST X) A1)
		      (TAUTOLOGYP (LEFT-BRANCH X) A1))
		 (VALUE (RIGHT-BRANCH X)
			(APPEND A1 A2))),

  which we further simplify, applying the lemmas
  ASSIGNMENT-IMPLIES-ASSIGNED, ASSIGNMENT-APPEND, and VALUE-SHORT-CUT,
  and opening up the definition of NORMALIZED-IF-EXPRP, to:

        T.

Case 10.(IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (APPEND A1 A2)))
		      (VALUE (RIGHT-BRANCH X)
			     (APPEND (ASSUME-FALSE (TEST X) A1)
				     A2))
		      (NOT (TAUTOLOGYP (RIGHT-BRANCH X) A1))
		      (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		      (NORMALIZED-IF-EXPRP X)
		      (TAUTOLOGYP X A1))
		 (VALUE X (APPEND A1 A2))),

  which we simplify, expanding the functions NORMALIZED-IF-EXPRP,
  TAUTOLOGYP, and VALUE, to two new conjectures:

  Case 10.2.
          (IMPLIES (AND (IF-EXPRP X)
			(NOT (VALUE (TEST X) (APPEND A1 A2)))
			(VALUE (RIGHT-BRANCH X)
			       (APPEND (ASSUME-FALSE (TEST X) A1)
				       A2))
			(NOT (TAUTOLOGYP (RIGHT-BRANCH X) A1))
			(NOT (NORMALIZED-IF-EXPRP (TEST X)))
			(NOT (IF-EXPRP (TEST X)))
			(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
			(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
			(NOT (ASSIGNEDP (TEST X) A1))
			(TAUTOLOGYP (LEFT-BRANCH X)
				    (ASSUME-TRUE (TEST X) A1))
			(TAUTOLOGYP (RIGHT-BRANCH X)
				    (ASSUME-FALSE (TEST X) A1)))
		   (VALUE (RIGHT-BRANCH X)
			  (APPEND A1 A2))),

    which we further simplify, applying ASSIGNMENT-APPEND,
    VALUE-SHORT-CUT, CDR-CONS, CAR-CONS, and
    VALUE-CAN-IGNORE-REDUNDANT-ASSIGNMENTS, and unfolding the
    functions NORMALIZED-IF-EXPRP, ASSUME-FALSE, APPEND, and IFF, to:

          T.

  Case 10.1.
          (IMPLIES (AND (IF-EXPRP X)
			(NOT (VALUE (TEST X) (APPEND A1 A2)))
			(VALUE (RIGHT-BRANCH X)
			       (APPEND (ASSUME-FALSE (TEST X) A1)
				       A2))
			(NOT (TAUTOLOGYP (RIGHT-BRANCH X) A1))
			(NOT (NORMALIZED-IF-EXPRP (TEST X)))
			(NOT (IF-EXPRP (TEST X)))
			(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
			(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
			(ASSIGNEDP (TEST X) A1)
			(ASSIGNMENT (TEST X) A1)
			(TAUTOLOGYP (LEFT-BRANCH X) A1))
		   (VALUE (RIGHT-BRANCH X)
			  (APPEND A1 A2))).

    However this again simplifies, applying
    ASSIGNMENT-IMPLIES-ASSIGNED, to the goal:

          (IMPLIES (AND (IF-EXPRP X)
			(NOT (VALUE (TEST X) (APPEND A1 A2)))
			(VALUE (RIGHT-BRANCH X)
			       (APPEND (ASSUME-FALSE (TEST X) A1)
				       A2))
			(NOT (TAUTOLOGYP (RIGHT-BRANCH X) A1))
			(NOT (NORMALIZED-IF-EXPRP (TEST X)))
			(NOT (IF-EXPRP (TEST X)))
			(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
			(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
			(ASSIGNMENT (TEST X) A1)
			(TAUTOLOGYP (LEFT-BRANCH X) A1))
		   (VALUE (RIGHT-BRANCH X)
			  (APPEND A1 A2))),

    which further simplifies, applying ASSIGNMENT-IMPLIES-ASSIGNED,
    ASSIGNMENT-APPEND, and VALUE-SHORT-CUT, and unfolding the
    definition of NORMALIZED-IF-EXPRP, to:

          T.

Case 9. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (APPEND A1 A2)))
		      (NOT (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X)))
		      (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		      (NORMALIZED-IF-EXPRP X)
		      (TAUTOLOGYP X A1))
		 (VALUE X (APPEND A1 A2))).

  This simplifies, unfolding the definition of NORMALIZED-IF-EXPRP,
  to:

        T.

Case 8. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (APPEND A1 A2)))
		      (NOT (TAUTOLOGYP (RIGHT-BRANCH X)
				       (ASSUME-FALSE (TEST X) A1)))
		      (VALUE (RIGHT-BRANCH X)
			     (APPEND A1 A2))
		      (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		      (NORMALIZED-IF-EXPRP X)
		      (TAUTOLOGYP X A1))
		 (VALUE X (APPEND A1 A2))).

  This simplifies, expanding the functions NORMALIZED-IF-EXPRP,
  TAUTOLOGYP, and VALUE, to:

        T.

Case 7. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (APPEND A1 A2)))
		      (VALUE (RIGHT-BRANCH X)
			     (APPEND (ASSUME-FALSE (TEST X) A1)
				     A2))
		      (VALUE (RIGHT-BRANCH X)
			     (APPEND A1 A2))
		      (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		      (NORMALIZED-IF-EXPRP X)
		      (TAUTOLOGYP X A1))
		 (VALUE X (APPEND A1 A2))),

  which simplifies, opening up the functions NORMALIZED-IF-EXPRP,
  TAUTOLOGYP, and VALUE, to:

        T.

Case 6. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (APPEND A1 A2)))
		      (NOT (TAUTOLOGYP (RIGHT-BRANCH X)
				       (ASSUME-FALSE (TEST X) A1)))
		      (NOT (TAUTOLOGYP (RIGHT-BRANCH X) A1))
		      (NOT (TAUTOLOGYP (TEST X) A1))
		      (NORMALIZED-IF-EXPRP X)
		      (TAUTOLOGYP X A1))
		 (VALUE X (APPEND A1 A2))).

  This simplifies, expanding the definitions of NORMALIZED-IF-EXPRP,
  TAUTOLOGYP, and VALUE, to:

        (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (APPEND A1 A2)))
		      (NOT (TAUTOLOGYP (RIGHT-BRANCH X)
				       (ASSUME-FALSE (TEST X) A1)))
		      (NOT (TAUTOLOGYP (RIGHT-BRANCH X) A1))
		      (NOT (TAUTOLOGYP (TEST X) A1))
		      (NOT (IF-EXPRP (TEST X)))
		      (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		      (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		      (ASSIGNEDP (TEST X) A1)
		      (ASSIGNMENT (TEST X) A1)
		      (TAUTOLOGYP (LEFT-BRANCH X) A1))
		 (VALUE (RIGHT-BRANCH X)
			(APPEND A1 A2))).

  This simplifies again, rewriting with the lemma
  ASSIGNMENT-IMPLIES-ASSIGNED, to:

        (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (APPEND A1 A2)))
		      (NOT (TAUTOLOGYP (RIGHT-BRANCH X)
				       (ASSUME-FALSE (TEST X) A1)))
		      (NOT (TAUTOLOGYP (RIGHT-BRANCH X) A1))
		      (NOT (TAUTOLOGYP (TEST X) A1))
		      (NOT (IF-EXPRP (TEST X)))
		      (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		      (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		      (ASSIGNMENT (TEST X) A1)
		      (TAUTOLOGYP (LEFT-BRANCH X) A1))
		 (VALUE (RIGHT-BRANCH X)
			(APPEND A1 A2))).

  However this simplifies further, applying
  ASSIGNMENT-IMPLIES-ASSIGNED, ASSIGNMENT-APPEND, and VALUE-SHORT-CUT,
  and opening up NORMALIZED-IF-EXPRP, to:

        T.

Case 5. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (APPEND A1 A2)))
		      (VALUE (RIGHT-BRANCH X)
			     (APPEND (ASSUME-FALSE (TEST X) A1)
				     A2))
		      (NOT (TAUTOLOGYP (RIGHT-BRANCH X) A1))
		      (NOT (TAUTOLOGYP (TEST X) A1))
		      (NORMALIZED-IF-EXPRP X)
		      (TAUTOLOGYP X A1))
		 (VALUE X (APPEND A1 A2))).

  This simplifies, opening up the functions NORMALIZED-IF-EXPRP,
  TAUTOLOGYP, and VALUE, to two new conjectures:

  Case 5.2.
          (IMPLIES (AND (IF-EXPRP X)
			(NOT (VALUE (TEST X) (APPEND A1 A2)))
			(VALUE (RIGHT-BRANCH X)
			       (APPEND (ASSUME-FALSE (TEST X) A1)
				       A2))
			(NOT (TAUTOLOGYP (RIGHT-BRANCH X) A1))
			(NOT (TAUTOLOGYP (TEST X) A1))
			(NOT (IF-EXPRP (TEST X)))
			(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
			(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
			(NOT (ASSIGNEDP (TEST X) A1))
			(TAUTOLOGYP (LEFT-BRANCH X)
				    (ASSUME-TRUE (TEST X) A1))
			(TAUTOLOGYP (RIGHT-BRANCH X)
				    (ASSUME-FALSE (TEST X) A1)))
		   (VALUE (RIGHT-BRANCH X)
			  (APPEND A1 A2))),

    which further simplifies, applying the lemmas ASSIGNMENT-APPEND,
    VALUE-SHORT-CUT, CDR-CONS, CAR-CONS, and
    VALUE-CAN-IGNORE-REDUNDANT-ASSIGNMENTS, and unfolding the
    definitions of NORMALIZED-IF-EXPRP, ASSUME-FALSE, APPEND, and IFF,
    to:

          T.

  Case 5.1.
          (IMPLIES (AND (IF-EXPRP X)
			(NOT (VALUE (TEST X) (APPEND A1 A2)))
			(VALUE (RIGHT-BRANCH X)
			       (APPEND (ASSUME-FALSE (TEST X) A1)
				       A2))
			(NOT (TAUTOLOGYP (RIGHT-BRANCH X) A1))
			(NOT (TAUTOLOGYP (TEST X) A1))
			(NOT (IF-EXPRP (TEST X)))
			(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
			(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
			(ASSIGNEDP (TEST X) A1)
			(ASSIGNMENT (TEST X) A1)
			(TAUTOLOGYP (LEFT-BRANCH X) A1))
		   (VALUE (RIGHT-BRANCH X)
			  (APPEND A1 A2))).

    But this simplifies again, rewriting with
    ASSIGNMENT-IMPLIES-ASSIGNED, to:

          (IMPLIES (AND (IF-EXPRP X)
			(NOT (VALUE (TEST X) (APPEND A1 A2)))
			(VALUE (RIGHT-BRANCH X)
			       (APPEND (ASSUME-FALSE (TEST X) A1)
				       A2))
			(NOT (TAUTOLOGYP (RIGHT-BRANCH X) A1))
			(NOT (TAUTOLOGYP (TEST X) A1))
			(NOT (IF-EXPRP (TEST X)))
			(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
			(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
			(ASSIGNMENT (TEST X) A1)
			(TAUTOLOGYP (LEFT-BRANCH X) A1))
		   (VALUE (RIGHT-BRANCH X)
			  (APPEND A1 A2))).

    This further simplifies, rewriting with
    ASSIGNMENT-IMPLIES-ASSIGNED, ASSIGNMENT-APPEND, and
    VALUE-SHORT-CUT, and opening up NORMALIZED-IF-EXPRP, to:

          T.

Case 4. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (APPEND A1 A2)))
		      (NOT (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X)))
		      (NOT (TAUTOLOGYP (TEST X) A1))
		      (NORMALIZED-IF-EXPRP X)
		      (TAUTOLOGYP X A1))
		 (VALUE X (APPEND A1 A2))),

  which simplifies, unfolding the definition of NORMALIZED-IF-EXPRP,
  to:

        T.

Case 3. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (APPEND A1 A2)))
		      (NOT (TAUTOLOGYP (RIGHT-BRANCH X)
				       (ASSUME-FALSE (TEST X) A1)))
		      (VALUE (RIGHT-BRANCH X)
			     (APPEND A1 A2))
		      (NOT (TAUTOLOGYP (TEST X) A1))
		      (NORMALIZED-IF-EXPRP X)
		      (TAUTOLOGYP X A1))
		 (VALUE X (APPEND A1 A2))).

  This simplifies, unfolding the definitions of NORMALIZED-IF-EXPRP,
  TAUTOLOGYP, and VALUE, to:

        T.

Case 2. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (APPEND A1 A2)))
		      (VALUE (RIGHT-BRANCH X)
			     (APPEND (ASSUME-FALSE (TEST X) A1)
				     A2))
		      (VALUE (RIGHT-BRANCH X)
			     (APPEND A1 A2))
		      (NOT (TAUTOLOGYP (TEST X) A1))
		      (NORMALIZED-IF-EXPRP X)
		      (TAUTOLOGYP X A1))
		 (VALUE X (APPEND A1 A2))).

  This simplifies, unfolding the functions NORMALIZED-IF-EXPRP,
  TAUTOLOGYP, and VALUE, to:

        T.

Case 1. (IMPLIES (AND (NOT (IF-EXPRP X))
		      (NORMALIZED-IF-EXPRP X)
		      (TAUTOLOGYP X A1))
		 (VALUE X (APPEND A1 A2))).

  This simplifies, rewriting with ASSIGNMENT-IMPLIES-ASSIGNED and
  ASSIGNMENT-APPEND, and unfolding NORMALIZED-IF-EXPRP, TAUTOLOGYP,
  and VALUE, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 23.8689942 1.59800619 ]

TAUTOLOGYP-IS-SOUND 


(DEFN TAUTOLOGY-CHECKER
      (X)
      (TAUTOLOGYP (NORMALIZE X) NIL))
   




[ 0.0329915364 3.0029297E-3 ]

TAUTOLOGY-CHECKER 


(DEFN FALSIFY1
      (X ALIST)
      (IF (IF-EXPRP X)
	  (IF (ASSIGNEDP (TEST X) ALIST)
	      (IF (ASSIGNMENT (TEST X) ALIST)
		  (FALSIFY1 (LEFT-BRANCH X) ALIST)
		  (FALSIFY1 (RIGHT-BRANCH X) ALIST))
	      (IF (FALSIFY1 (LEFT-BRANCH X)
			    (ASSUME-TRUE (TEST X) ALIST))
		  (FALSIFY1 (LEFT-BRANCH X)
			    (ASSUME-TRUE (TEST X) ALIST))
		  (FALSIFY1 (RIGHT-BRANCH X)
			    (ASSUME-FALSE (TEST X) ALIST))))
	  (IF (ASSIGNEDP X ALIST)
	      (IF (ASSIGNMENT X ALIST) F ALIST)
	      (CONS (CONS X F) ALIST))))
     Linear arithmetic and the lemmas LEFT-BRANCH-LESSP and
RIGHT-BRANCH-LESSP inform us that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, FALSIFY1 is accepted under the principle of definition.
Observe that:
      (OR (OR (FALSEP (FALSIFY1 X ALIST))
	      (LISTP (FALSIFY1 X ALIST)))
	  (EQUAL (FALSIFY1 X ALIST) ALIST))
is a theorem.




[ 1.38098958 0.0510009765 ]

FALSIFY1 


(DEFN FALSIFY
      (X)
      (FALSIFY1 (NORMALIZE X) NIL))
     From the definition we can conclude that:
      (OR (FALSEP (FALSIFY X))
	  (LITATOM (FALSIFY X))
	  (LISTP (FALSIFY X)))
is a theorem.




[ 0.031998698 0.0200032552 ]

FALSIFY 


(PROVE-LEMMA FALSIFY1-EXTENDS-MODELS
	     (REWRITE)
	     (IMPLIES (ASSIGNEDP X A)
		      (EQUAL (ASSIGNMENT X (FALSIFY1 Y A))
			     (IF (FALSIFY1 Y A)
				 (ASSIGNMENT X A)
				 (EQUAL X T)))))
This simplifies, trivially, to two new conjectures:

Case 2. (IMPLIES (AND (ASSIGNEDP X A)
		      (NOT (FALSIFY1 Y A)))
		 (EQUAL (ASSIGNMENT X (FALSIFY1 Y A))
			(EQUAL X T))).

  However this again simplifies, opening up the definitions of LISTP
  and ASSIGNMENT, to:

        T.

Case 1. (IMPLIES (AND (ASSIGNEDP X A) (FALSIFY1 Y A))
		 (EQUAL (ASSIGNMENT X (FALSIFY1 Y A))
			(ASSIGNMENT X A))).

  Call the above conjecture *1.


     Let us appeal to the induction principle.  There are four
plausible inductions.  They merge into two likely candidate
inductions.  However, only one is unflawed.  We will induct according
to the following scheme:
      (AND (IMPLIES (AND (IF-EXPRP Y)
			 (ASSIGNEDP (TEST Y) A)
			 (ASSIGNMENT (TEST Y) A)
			 (P X (LEFT-BRANCH Y) A))
		    (P X Y A))
	   (IMPLIES (AND (IF-EXPRP Y)
			 (ASSIGNEDP (TEST Y) A)
			 (NOT (ASSIGNMENT (TEST Y) A))
			 (P X (RIGHT-BRANCH Y) A))
		    (P X Y A))
	   (IMPLIES (AND (IF-EXPRP Y)
			 (NOT (ASSIGNEDP (TEST Y) A))
			 (FALSIFY1 (LEFT-BRANCH Y)
				   (ASSUME-TRUE (TEST Y) A))
			 (P X
			    (LEFT-BRANCH Y)
			    (ASSUME-TRUE (TEST Y) A)))
		    (P X Y A))
	   (IMPLIES (AND (IF-EXPRP Y)
			 (NOT (ASSIGNEDP (TEST Y) A))
			 (NOT (FALSIFY1 (LEFT-BRANCH Y)
					(ASSUME-TRUE (TEST Y) A)))
			 (P X
			    (LEFT-BRANCH Y)
			    (ASSUME-TRUE (TEST Y) A))
			 (P X
			    (RIGHT-BRANCH Y)
			    (ASSUME-FALSE (TEST Y) A)))
		    (P X Y A))
	   (IMPLIES (AND (NOT (IF-EXPRP Y))
			 (ASSIGNEDP Y A)
			 (ASSIGNMENT Y A))
		    (P X Y A))
	   (IMPLIES (AND (NOT (IF-EXPRP Y))
			 (ASSIGNEDP Y A)
			 (NOT (ASSIGNMENT Y A)))
		    (P X Y A))
	   (IMPLIES (AND (NOT (IF-EXPRP Y))
			 (NOT (ASSIGNEDP Y A)))
		    (P X Y A))).
Linear arithmetic and the lemmas LEFT-BRANCH-LESSP and
RIGHT-BRANCH-LESSP establish that the measure (COUNT Y) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  Note, however, the inductive instances chosen for A.
The above induction scheme generates 12 new goals:

Case 12.(IMPLIES (AND (IF-EXPRP Y)
		      (ASSIGNEDP (TEST Y) A)
		      (ASSIGNMENT (TEST Y) A)
		      (NOT (FALSIFY1 (LEFT-BRANCH Y) A))
		      (ASSIGNEDP X A)
		      (FALSIFY1 Y A))
		 (EQUAL (ASSIGNMENT X (FALSIFY1 Y A))
			(ASSIGNMENT X A))).

  This simplifies, rewriting with the lemma
  ASSIGNMENT-IMPLIES-ASSIGNED, and unfolding the function FALSIFY1,
  to:

        T.

Case 11.(IMPLIES (AND (IF-EXPRP Y)
		      (ASSIGNEDP (TEST Y) A)
		      (ASSIGNMENT (TEST Y) A)
		      (EQUAL (ASSIGNMENT X
					 (FALSIFY1 (LEFT-BRANCH Y) A))
			     (ASSIGNMENT X A))
		      (ASSIGNEDP X A)
		      (FALSIFY1 Y A))
		 (EQUAL (ASSIGNMENT X (FALSIFY1 Y A))
			(ASSIGNMENT X A))).

  This simplifies, rewriting with ASSIGNMENT-IMPLIES-ASSIGNED, and
  expanding FALSIFY1, to:

        T.

Case 10.(IMPLIES (AND (IF-EXPRP Y)
		      (ASSIGNEDP (TEST Y) A)
		      (NOT (ASSIGNMENT (TEST Y) A))
		      (NOT (FALSIFY1 (RIGHT-BRANCH Y) A))
		      (ASSIGNEDP X A)
		      (FALSIFY1 Y A))
		 (EQUAL (ASSIGNMENT X (FALSIFY1 Y A))
			(ASSIGNMENT X A))),

  which we simplify, opening up FALSIFY1, to:

        T.

Case 9. (IMPLIES
		(AND (IF-EXPRP Y)
		     (ASSIGNEDP (TEST Y) A)
		     (NOT (ASSIGNMENT (TEST Y) A))
		     (EQUAL (ASSIGNMENT X
					(FALSIFY1 (RIGHT-BRANCH Y) A))
			    (ASSIGNMENT X A))
		     (ASSIGNEDP X A)
		     (FALSIFY1 Y A))
		(EQUAL (ASSIGNMENT X (FALSIFY1 Y A))
		       (ASSIGNMENT X A))),

  which simplifies, expanding the definition of FALSIFY1, to:

        T.

Case 8. (IMPLIES (AND (IF-EXPRP Y)
		      (NOT (ASSIGNEDP (TEST Y) A))
		      (FALSIFY1 (LEFT-BRANCH Y)
				(ASSUME-TRUE (TEST Y) A))
		      (NOT (ASSIGNEDP X
				      (ASSUME-TRUE (TEST Y) A)))
		      (ASSIGNEDP X A)
		      (FALSIFY1 Y A))
		 (EQUAL (ASSIGNMENT X (FALSIFY1 Y A))
			(ASSIGNMENT X A))),

  which we simplify, rewriting with CDR-CONS and CAR-CONS, and
  unfolding the definitions of ASSUME-TRUE and ASSIGNEDP, to:

        T.

Case 7. (IMPLIES
	  (AND (IF-EXPRP Y)
	       (NOT (ASSIGNEDP (TEST Y) A))
	       (FALSIFY1 (LEFT-BRANCH Y)
			 (ASSUME-TRUE (TEST Y) A))
	       (EQUAL (ASSIGNMENT X
				  (FALSIFY1 (LEFT-BRANCH Y)
					    (ASSUME-TRUE (TEST Y) A)))
		      (ASSIGNMENT X
				  (ASSUME-TRUE (TEST Y) A)))
	       (ASSIGNEDP X A)
	       (FALSIFY1 Y A))
	  (EQUAL (ASSIGNMENT X (FALSIFY1 Y A))
		 (ASSIGNMENT X A))).

  This simplifies, applying CDR-CONS, CAR-CONS, and
  ASSIGNMENT-IMPLIES-ASSIGNED, and expanding the functions
  ASSUME-TRUE, ASSIGNMENT, FALSIFY1, EQUAL, and ASSIGNEDP, to two new
  conjectures:

  Case 7.2.
          (IMPLIES
	   (AND
	       (IF-EXPRP Y)
	       (NOT (ASSIGNEDP (TEST Y) A))
	       (FALSIFY1 (LEFT-BRANCH Y)
			 (ASSUME-TRUE (TEST Y) A))
	       X
	       (EQUAL X (TEST Y))
	       (EQUAL (ASSIGNMENT X
				  (FALSIFY1 (LEFT-BRANCH Y)
					    (ASSUME-TRUE (TEST Y) A)))
		      T)
	       (ASSIGNEDP X A)
	       (NOT (ASSIGNMENT X A))
	       (FALSIFY1 (RIGHT-BRANCH Y) A))
	   (NOT (ASSIGNMENT X
			    (FALSIFY1 (RIGHT-BRANCH Y) A)))),

    which we again simplify, obviously, to:

          T.

  Case 7.1.
          (IMPLIES
	   (AND
	       (IF-EXPRP Y)
	       (NOT (ASSIGNEDP (TEST Y) A))
	       (FALSIFY1 (LEFT-BRANCH Y)
			 (ASSUME-TRUE (TEST Y) A))
	       X
	       (EQUAL X (TEST Y))
	       (EQUAL (ASSIGNMENT X
				  (FALSIFY1 (LEFT-BRANCH Y)
					    (ASSUME-TRUE (TEST Y) A)))
		      T)
	       (ASSIGNEDP X A)
	       (ASSIGNMENT X A)
	       (FALSIFY1 (LEFT-BRANCH Y) A))
	   (EQUAL (ASSIGNMENT X
			      (FALSIFY1 (LEFT-BRANCH Y) A))
		  (ASSIGNMENT X A))),

    which we again simplify, clearly, to:

          T.

Case 6. (IMPLIES (AND (IF-EXPRP Y)
		      (NOT (ASSIGNEDP (TEST Y) A))
		      (NOT (FALSIFY1 (LEFT-BRANCH Y)
				     (ASSUME-TRUE (TEST Y) A)))
		      (NOT (ASSIGNEDP X
				      (ASSUME-FALSE (TEST Y) A)))
		      (ASSIGNEDP X A)
		      (FALSIFY1 Y A))
		 (EQUAL (ASSIGNMENT X (FALSIFY1 Y A))
			(ASSIGNMENT X A))),

  which we simplify, rewriting with the lemmas CDR-CONS and CAR-CONS,
  and expanding the definitions of ASSUME-FALSE and ASSIGNEDP, to:

        T.

Case 5. (IMPLIES (AND (IF-EXPRP Y)
		      (NOT (ASSIGNEDP (TEST Y) A))
		      (NOT (FALSIFY1 (LEFT-BRANCH Y)
				     (ASSUME-TRUE (TEST Y) A)))
		      (NOT (FALSIFY1 (RIGHT-BRANCH Y)
				     (ASSUME-FALSE (TEST Y) A)))
		      (ASSIGNEDP X A)
		      (FALSIFY1 Y A))
		 (EQUAL (ASSIGNMENT X (FALSIFY1 Y A))
			(ASSIGNMENT X A))).

  This simplifies, expanding the definition of FALSIFY1, to:

        T.

Case 4. (IMPLIES
	 (AND (IF-EXPRP Y)
	      (NOT (ASSIGNEDP (TEST Y) A))
	      (NOT (FALSIFY1 (LEFT-BRANCH Y)
			     (ASSUME-TRUE (TEST Y) A)))
	      (EQUAL (ASSIGNMENT X
				 (FALSIFY1 (RIGHT-BRANCH Y)
					   (ASSUME-FALSE (TEST Y) A)))
		     (ASSIGNMENT X
				 (ASSUME-FALSE (TEST Y) A)))
	      (ASSIGNEDP X A)
	      (FALSIFY1 Y A))
	 (EQUAL (ASSIGNMENT X (FALSIFY1 Y A))
		(ASSIGNMENT X A))).

  This simplifies, appealing to the lemmas CDR-CONS, CAR-CONS, and
  ASSIGNMENT-IMPLIES-ASSIGNED, and unfolding the definitions of
  ASSUME-FALSE, ASSIGNMENT, FALSIFY1, EQUAL, and ASSIGNEDP, to two
  new goals:

  Case 4.2.
          (IMPLIES
	   (AND
	      (IF-EXPRP Y)
	      (NOT (ASSIGNEDP (TEST Y) A))
	      (NOT (FALSIFY1 (LEFT-BRANCH Y)
			     (ASSUME-TRUE (TEST Y) A)))
	      (NOT (EQUAL X T))
	      (EQUAL X (TEST Y))
	      (EQUAL (ASSIGNMENT X
				 (FALSIFY1 (RIGHT-BRANCH Y)
					   (ASSUME-FALSE (TEST Y) A)))
		     F)
	      (ASSIGNEDP X A)
	      (NOT (ASSIGNMENT X A))
	      (FALSIFY1 (RIGHT-BRANCH Y) A))
	   (NOT (ASSIGNMENT X
			    (FALSIFY1 (RIGHT-BRANCH Y) A)))).

    This simplifies again, clearly, to:

          T.

  Case 4.1.
          (IMPLIES
	   (AND
	      (IF-EXPRP Y)
	      (NOT (ASSIGNEDP (TEST Y) A))
	      (NOT (FALSIFY1 (LEFT-BRANCH Y)
			     (ASSUME-TRUE (TEST Y) A)))
	      (NOT (EQUAL X T))
	      (EQUAL X (TEST Y))
	      (EQUAL (ASSIGNMENT X
				 (FALSIFY1 (RIGHT-BRANCH Y)
					   (ASSUME-FALSE (TEST Y) A)))
		     F)
	      (ASSIGNEDP X A)
	      (ASSIGNMENT X A)
	      (FALSIFY1 (LEFT-BRANCH Y) A))
	   (EQUAL (ASSIGNMENT X
			      (FALSIFY1 (LEFT-BRANCH Y) A))
		  (ASSIGNMENT X A))),

    which we again simplify, trivially, to:

          T.

Case 3. (IMPLIES (AND (NOT (IF-EXPRP Y))
		      (ASSIGNEDP Y A)
		      (ASSIGNMENT Y A)
		      (ASSIGNEDP X A)
		      (FALSIFY1 Y A))
		 (EQUAL (ASSIGNMENT X (FALSIFY1 Y A))
			(ASSIGNMENT X A))),

  which we simplify, applying the lemma ASSIGNMENT-IMPLIES-ASSIGNED,
  and expanding FALSIFY1, to:

        T.

Case 2. (IMPLIES (AND (NOT (IF-EXPRP Y))
		      (ASSIGNEDP Y A)
		      (NOT (ASSIGNMENT Y A))
		      (ASSIGNEDP X A)
		      (FALSIFY1 Y A))
		 (EQUAL (ASSIGNMENT X (FALSIFY1 Y A))
			(ASSIGNMENT X A))),

  which simplifies, unfolding the function FALSIFY1, to:

        T.

Case 1. (IMPLIES (AND (NOT (IF-EXPRP Y))
		      (NOT (ASSIGNEDP Y A))
		      (ASSIGNEDP X A)
		      (FALSIFY1 Y A))
		 (EQUAL (ASSIGNMENT X (FALSIFY1 Y A))
			(ASSIGNMENT X A))).

  This simplifies, applying CDR-CONS and CAR-CONS, and opening up
  FALSIFY1 and ASSIGNMENT, to the following three new conjectures:

  Case 1.3.
          (IMPLIES (AND (NOT (IF-EXPRP Y))
			(NOT (ASSIGNEDP Y A))
			(ASSIGNEDP X A)
			(NOT (EQUAL X T))
			(NOT X))
		   (EQUAL F (ASSIGNMENT X A))).

    This again simplifies, rewriting with the lemma
    ASSIGNMENT-IMPLIES-ASSIGNED, and expanding the functions EQUAL
    and ASSIGNMENT, to:

          T.

  Case 1.2.
          (IMPLIES (AND (NOT (IF-EXPRP Y))
			(NOT (ASSIGNEDP Y A))
			(ASSIGNEDP X A)
			(NOT (EQUAL X T))
			(EQUAL X Y))
		   (EQUAL F (ASSIGNMENT X A))),

    which we again simplify, trivially, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NOT (IF-EXPRP Y))
			(NOT (ASSIGNEDP Y A))
			(ASSIGNEDP X A)
			(EQUAL X T))
		   (EQUAL T (ASSIGNMENT X A))),

    which again simplifies, appealing to the lemma
    ASSIGNMENT-IMPLIES-ASSIGNED, and opening up ASSIGNMENT and EQUAL,
    to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 19.6760173 1.06298828 ]

FALSIFY1-EXTENDS-MODELS 


(PROVE-LEMMA FALSIFY1-FALSIFIES
	     (REWRITE)
	     (IMPLIES (AND (NORMALIZED-IF-EXPRP X)
			   (FALSIFY1 X A))
		      (EQUAL (VALUE X (FALSIFY1 X A)) F)))

     Name the conjecture *1.


     Perhaps we can prove it by induction.  The recursive terms in
the conjecture suggest four inductions.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (IF-EXPRP X)
			 (VALUE (TEST X) (FALSIFY1 X A))
			 (P (TEST X) A)
			 (P (LEFT-BRANCH X) A)
			 (P (LEFT-BRANCH X)
			    (ASSUME-TRUE (TEST X) A)))
		    (P X A))
	   (IMPLIES (AND (IF-EXPRP X)
			 (NOT (VALUE (TEST X) (FALSIFY1 X A)))
			 (P (TEST X) A)
			 (P (RIGHT-BRANCH X) A)
			 (P (RIGHT-BRANCH X)
			    (ASSUME-FALSE (TEST X) A)))
		    (P X A))
	   (IMPLIES (NOT (IF-EXPRP X)) (P X A))).
Linear arithmetic and the lemmas TEST-LESSP, LEFT-BRANCH-LESSP, and
RIGHT-BRANCH-LESSP inform us that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  Note, however, the inductive instances chosen for A.
The above induction scheme produces 31 new formulas:

Case 31.(IMPLIES (AND (IF-EXPRP X)
		      (VALUE (TEST X) (FALSIFY1 X A))
		      (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		      (NOT (FALSIFY1 (LEFT-BRANCH X) A))
		      (NOT (FALSIFY1 (LEFT-BRANCH X)
				     (ASSUME-TRUE (TEST X) A)))
		      (NORMALIZED-IF-EXPRP X)
		      (FALSIFY1 X A))
		 (NOT (VALUE X (FALSIFY1 X A)))).

  This simplifies, applying the lemmas VALUE-SHORT-CUT and
  ASSIGNMENT-IMPLIES-ASSIGNED, and expanding the definitions of
  FALSIFY1 and NORMALIZED-IF-EXPRP, to two new formulas:

  Case 31.2.
          (IMPLIES
		(AND (IF-EXPRP X)
		     (NOT (ASSIGNEDP (TEST X) A))
		     (ASSIGNMENT (TEST X)
				 (FALSIFY1 (RIGHT-BRANCH X)
					   (ASSUME-FALSE (TEST X) A)))
		     (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		     (NOT (FALSIFY1 (LEFT-BRANCH X) A))
		     (NOT (FALSIFY1 (LEFT-BRANCH X)
				    (ASSUME-TRUE (TEST X) A)))
		     (NOT (IF-EXPRP (TEST X)))
		     (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		     (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		     (FALSIFY1 (RIGHT-BRANCH X)
			       (ASSUME-FALSE (TEST X) A)))
		(NOT (VALUE X
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A))))),

    which we further simplify, rewriting with CAR-CONS, CDR-CONS, and
    FALSIFY1-EXTENDS-MODELS, and unfolding the functions ASSUME-FALSE,
    ASSIGNEDP, ASSIGNMENT, and NORMALIZED-IF-EXPRP, to:

          T.

  Case 31.1.
          (IMPLIES (AND (IF-EXPRP X)
			(ASSIGNEDP (TEST X) A)
			(NOT (ASSIGNMENT (TEST X) A))
			(ASSIGNMENT (TEST X)
				    (FALSIFY1 (RIGHT-BRANCH X) A))
			(NOT (NORMALIZED-IF-EXPRP (TEST X)))
			(NOT (FALSIFY1 (LEFT-BRANCH X) A))
			(NOT (FALSIFY1 (LEFT-BRANCH X)
				       (ASSUME-TRUE (TEST X) A)))
			(NOT (IF-EXPRP (TEST X)))
			(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
			(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
			(FALSIFY1 (RIGHT-BRANCH X) A))
		   (NOT (VALUE X
			       (FALSIFY1 (RIGHT-BRANCH X) A)))).

    But this simplifies again, applying FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 30.(IMPLIES (AND (IF-EXPRP X)
		      (VALUE (TEST X) (FALSIFY1 X A))
		      (NOT (FALSIFY1 (TEST X) A))
		      (NOT (FALSIFY1 (LEFT-BRANCH X) A))
		      (NOT (FALSIFY1 (LEFT-BRANCH X)
				     (ASSUME-TRUE (TEST X) A)))
		      (NORMALIZED-IF-EXPRP X)
		      (FALSIFY1 X A))
		 (NOT (VALUE X (FALSIFY1 X A)))),

  which we simplify, rewriting with VALUE-SHORT-CUT and
  ASSIGNMENT-IMPLIES-ASSIGNED, and opening up FALSIFY1 and
  NORMALIZED-IF-EXPRP, to two new conjectures:

  Case 30.2.
          (IMPLIES
		(AND (IF-EXPRP X)
		     (NOT (ASSIGNEDP (TEST X) A))
		     (ASSIGNMENT (TEST X)
				 (FALSIFY1 (RIGHT-BRANCH X)
					   (ASSUME-FALSE (TEST X) A)))
		     (NOT (FALSIFY1 (TEST X) A))
		     (NOT (FALSIFY1 (LEFT-BRANCH X) A))
		     (NOT (FALSIFY1 (LEFT-BRANCH X)
				    (ASSUME-TRUE (TEST X) A)))
		     (NOT (IF-EXPRP (TEST X)))
		     (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		     (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		     (FALSIFY1 (RIGHT-BRANCH X)
			       (ASSUME-FALSE (TEST X) A)))
		(NOT (VALUE X
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A))))),

    which we further simplify, rewriting with the lemmas CAR-CONS,
    CDR-CONS, FALSIFY1-EXTENDS-MODELS, and
    ASSIGNMENT-IMPLIES-ASSIGNED, and unfolding ASSUME-FALSE,
    ASSIGNEDP, ASSIGNMENT, EQUAL, IF-EXPRP, FALSIFY1, CONS, and
    ASSUME-TRUE, to:

          (IMPLIES
	       (AND (IF-EXPRP X)
		    (NOT (ASSIGNEDP (TEST X) A))
		    (EQUAL (TEST X) T)
		    (NOT (FALSIFY1 (LEFT-BRANCH X) A))
		    (NOT (FALSIFY1 (LEFT-BRANCH X)
				   (CONS '(1TRUE . 1TRUE) A)))
		    (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		    (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		    (FALSIFY1 (RIGHT-BRANCH X)
			      (CONS '(1TRUE . 1FALSE) A)))
	       (NOT (VALUE X
			   (FALSIFY1 (RIGHT-BRANCH X)
				     (CONS '(1TRUE . 1FALSE) A))))).

    However this simplifies again, applying
    ASSIGNMENT-IMPLIES-ASSIGNED, and opening up ASSIGNMENT and EQUAL,
    to:

          T.

  Case 30.1.
          (IMPLIES (AND (IF-EXPRP X)
			(ASSIGNEDP (TEST X) A)
			(NOT (ASSIGNMENT (TEST X) A))
			(ASSIGNMENT (TEST X)
				    (FALSIFY1 (RIGHT-BRANCH X) A))
			(NOT (FALSIFY1 (TEST X) A))
			(NOT (FALSIFY1 (LEFT-BRANCH X) A))
			(NOT (FALSIFY1 (LEFT-BRANCH X)
				       (ASSUME-TRUE (TEST X) A)))
			(NOT (IF-EXPRP (TEST X)))
			(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
			(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
			(FALSIFY1 (RIGHT-BRANCH X) A))
		   (NOT (VALUE X
			       (FALSIFY1 (RIGHT-BRANCH X) A)))).

    But this simplifies again, rewriting with FALSIFY1-EXTENDS-MODELS,
    to:

          T.

Case 29.(IMPLIES (AND (IF-EXPRP X)
		      (VALUE (TEST X) (FALSIFY1 X A))
		      (NOT (VALUE (TEST X)
				  (FALSIFY1 (TEST X) A)))
		      (NOT (FALSIFY1 (LEFT-BRANCH X) A))
		      (NOT (FALSIFY1 (LEFT-BRANCH X)
				     (ASSUME-TRUE (TEST X) A)))
		      (NORMALIZED-IF-EXPRP X)
		      (FALSIFY1 X A))
		 (NOT (VALUE X (FALSIFY1 X A)))),

  which we simplify, applying VALUE-SHORT-CUT and
  ASSIGNMENT-IMPLIES-ASSIGNED, and unfolding FALSIFY1 and
  NORMALIZED-IF-EXPRP, to two new formulas:

  Case 29.2.
          (IMPLIES
		(AND (IF-EXPRP X)
		     (NOT (ASSIGNEDP (TEST X) A))
		     (ASSIGNMENT (TEST X)
				 (FALSIFY1 (RIGHT-BRANCH X)
					   (ASSUME-FALSE (TEST X) A)))
		     (NOT (VALUE (TEST X)
				 (FALSIFY1 (TEST X) A)))
		     (NOT (FALSIFY1 (LEFT-BRANCH X) A))
		     (NOT (FALSIFY1 (LEFT-BRANCH X)
				    (ASSUME-TRUE (TEST X) A)))
		     (NOT (IF-EXPRP (TEST X)))
		     (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		     (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		     (FALSIFY1 (RIGHT-BRANCH X)
			       (ASSUME-FALSE (TEST X) A)))
		(NOT (VALUE X
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A))))),

    which we further simplify, rewriting with the lemmas CAR-CONS,
    CDR-CONS, FALSIFY1-EXTENDS-MODELS, and
    ASSIGNMENT-IMPLIES-ASSIGNED, and expanding the definitions of
    ASSUME-FALSE, ASSIGNEDP, ASSIGNMENT, EQUAL, IF-EXPRP, FALSIFY1,
    and VALUE, to:

          T.

  Case 29.1.
          (IMPLIES (AND (IF-EXPRP X)
			(ASSIGNEDP (TEST X) A)
			(NOT (ASSIGNMENT (TEST X) A))
			(ASSIGNMENT (TEST X)
				    (FALSIFY1 (RIGHT-BRANCH X) A))
			(NOT (VALUE (TEST X)
				    (FALSIFY1 (TEST X) A)))
			(NOT (FALSIFY1 (LEFT-BRANCH X) A))
			(NOT (FALSIFY1 (LEFT-BRANCH X)
				       (ASSUME-TRUE (TEST X) A)))
			(NOT (IF-EXPRP (TEST X)))
			(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
			(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
			(FALSIFY1 (RIGHT-BRANCH X) A))
		   (NOT (VALUE X
			       (FALSIFY1 (RIGHT-BRANCH X) A)))).

    This again simplifies, rewriting with the lemma
    FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 28.(IMPLIES (AND (IF-EXPRP X)
		      (VALUE (TEST X) (FALSIFY1 X A))
		      (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		      (NOT (VALUE (LEFT-BRANCH X)
				  (FALSIFY1 (LEFT-BRANCH X) A)))
		      (NOT (FALSIFY1 (LEFT-BRANCH X)
				     (ASSUME-TRUE (TEST X) A)))
		      (NORMALIZED-IF-EXPRP X)
		      (FALSIFY1 X A))
		 (NOT (VALUE X (FALSIFY1 X A)))),

  which we simplify, applying the lemmas VALUE-SHORT-CUT,
  ASSIGNMENT-IMPLIES-ASSIGNED, and FALSIFY1-EXTENDS-MODELS, and
  opening up the definitions of FALSIFY1, NORMALIZED-IF-EXPRP, and
  VALUE, to two new goals:

  Case 28.2.
          (IMPLIES
		(AND (IF-EXPRP X)
		     (NOT (ASSIGNEDP (TEST X) A))
		     (ASSIGNMENT (TEST X)
				 (FALSIFY1 (RIGHT-BRANCH X)
					   (ASSUME-FALSE (TEST X) A)))
		     (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X) A)))
		     (NOT (FALSIFY1 (LEFT-BRANCH X)
				    (ASSUME-TRUE (TEST X) A)))
		     (NOT (IF-EXPRP (TEST X)))
		     (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		     (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		     (FALSIFY1 (RIGHT-BRANCH X)
			       (ASSUME-FALSE (TEST X) A)))
		(NOT (VALUE X
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A))))),

    which we further simplify, applying the lemmas CAR-CONS, CDR-CONS,
    and FALSIFY1-EXTENDS-MODELS, and opening up the definitions of
    ASSUME-FALSE, ASSIGNEDP, ASSIGNMENT, and NORMALIZED-IF-EXPRP, to:

          T.

  Case 28.1.
          (IMPLIES (AND (IF-EXPRP X)
			(ASSIGNEDP (TEST X) A)
			(NOT (ASSIGNMENT (TEST X) A))
			(ASSIGNMENT (TEST X)
				    (FALSIFY1 (RIGHT-BRANCH X) A))
			(NOT (NORMALIZED-IF-EXPRP (TEST X)))
			(NOT (VALUE (LEFT-BRANCH X)
				    (FALSIFY1 (LEFT-BRANCH X) A)))
			(NOT (FALSIFY1 (LEFT-BRANCH X)
				       (ASSUME-TRUE (TEST X) A)))
			(NOT (IF-EXPRP (TEST X)))
			(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
			(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
			(FALSIFY1 (RIGHT-BRANCH X) A))
		   (NOT (VALUE X
			       (FALSIFY1 (RIGHT-BRANCH X) A)))),

    which we again simplify, appealing to the lemma
    FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 27.(IMPLIES (AND (IF-EXPRP X)
		      (VALUE (TEST X) (FALSIFY1 X A))
		      (NOT (FALSIFY1 (TEST X) A))
		      (NOT (VALUE (LEFT-BRANCH X)
				  (FALSIFY1 (LEFT-BRANCH X) A)))
		      (NOT (FALSIFY1 (LEFT-BRANCH X)
				     (ASSUME-TRUE (TEST X) A)))
		      (NORMALIZED-IF-EXPRP X)
		      (FALSIFY1 X A))
		 (NOT (VALUE X (FALSIFY1 X A)))),

  which simplifies, applying VALUE-SHORT-CUT,
  ASSIGNMENT-IMPLIES-ASSIGNED, and FALSIFY1-EXTENDS-MODELS, and
  opening up the definitions of FALSIFY1, NORMALIZED-IF-EXPRP, and
  VALUE, to two new formulas:

  Case 27.2.
          (IMPLIES
		(AND (IF-EXPRP X)
		     (NOT (ASSIGNEDP (TEST X) A))
		     (ASSIGNMENT (TEST X)
				 (FALSIFY1 (RIGHT-BRANCH X)
					   (ASSUME-FALSE (TEST X) A)))
		     (NOT (FALSIFY1 (TEST X) A))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X) A)))
		     (NOT (FALSIFY1 (LEFT-BRANCH X)
				    (ASSUME-TRUE (TEST X) A)))
		     (NOT (IF-EXPRP (TEST X)))
		     (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		     (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		     (FALSIFY1 (RIGHT-BRANCH X)
			       (ASSUME-FALSE (TEST X) A)))
		(NOT (VALUE X
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A))))).

    This further simplifies, applying CAR-CONS, CDR-CONS,
    FALSIFY1-EXTENDS-MODELS, and ASSIGNMENT-IMPLIES-ASSIGNED, and
    expanding the functions ASSUME-FALSE, ASSIGNEDP, ASSIGNMENT,
    EQUAL, IF-EXPRP, FALSIFY1, CONS, and ASSUME-TRUE, to:

          (IMPLIES
	       (AND (IF-EXPRP X)
		    (NOT (ASSIGNEDP (TEST X) A))
		    (EQUAL (TEST X) T)
		    (NOT (VALUE (LEFT-BRANCH X)
				(FALSIFY1 (LEFT-BRANCH X) A)))
		    (NOT (FALSIFY1 (LEFT-BRANCH X)
				   (CONS '(1TRUE . 1TRUE) A)))
		    (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		    (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		    (FALSIFY1 (RIGHT-BRANCH X)
			      (CONS '(1TRUE . 1FALSE) A)))
	       (NOT (VALUE X
			   (FALSIFY1 (RIGHT-BRANCH X)
				     (CONS '(1TRUE . 1FALSE) A))))),

    which again simplifies, applying ASSIGNMENT-IMPLIES-ASSIGNED, and
    expanding the functions ASSIGNMENT and EQUAL, to:

          T.

  Case 27.1.
          (IMPLIES (AND (IF-EXPRP X)
			(ASSIGNEDP (TEST X) A)
			(NOT (ASSIGNMENT (TEST X) A))
			(ASSIGNMENT (TEST X)
				    (FALSIFY1 (RIGHT-BRANCH X) A))
			(NOT (FALSIFY1 (TEST X) A))
			(NOT (VALUE (LEFT-BRANCH X)
				    (FALSIFY1 (LEFT-BRANCH X) A)))
			(NOT (FALSIFY1 (LEFT-BRANCH X)
				       (ASSUME-TRUE (TEST X) A)))
			(NOT (IF-EXPRP (TEST X)))
			(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
			(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
			(FALSIFY1 (RIGHT-BRANCH X) A))
		   (NOT (VALUE X
			       (FALSIFY1 (RIGHT-BRANCH X) A)))),

    which again simplifies, appealing to the lemma
    FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 26.(IMPLIES (AND (IF-EXPRP X)
		      (VALUE (TEST X) (FALSIFY1 X A))
		      (NOT (VALUE (TEST X)
				  (FALSIFY1 (TEST X) A)))
		      (NOT (VALUE (LEFT-BRANCH X)
				  (FALSIFY1 (LEFT-BRANCH X) A)))
		      (NOT (FALSIFY1 (LEFT-BRANCH X)
				     (ASSUME-TRUE (TEST X) A)))
		      (NORMALIZED-IF-EXPRP X)
		      (FALSIFY1 X A))
		 (NOT (VALUE X (FALSIFY1 X A)))).

  This simplifies, applying VALUE-SHORT-CUT,
  ASSIGNMENT-IMPLIES-ASSIGNED, and FALSIFY1-EXTENDS-MODELS, and
  expanding FALSIFY1, NORMALIZED-IF-EXPRP, and VALUE, to the
  following two new conjectures:

  Case 26.2.
          (IMPLIES
		(AND (IF-EXPRP X)
		     (NOT (ASSIGNEDP (TEST X) A))
		     (ASSIGNMENT (TEST X)
				 (FALSIFY1 (RIGHT-BRANCH X)
					   (ASSUME-FALSE (TEST X) A)))
		     (NOT (VALUE (TEST X)
				 (FALSIFY1 (TEST X) A)))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X) A)))
		     (NOT (FALSIFY1 (LEFT-BRANCH X)
				    (ASSUME-TRUE (TEST X) A)))
		     (NOT (IF-EXPRP (TEST X)))
		     (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		     (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		     (FALSIFY1 (RIGHT-BRANCH X)
			       (ASSUME-FALSE (TEST X) A)))
		(NOT (VALUE X
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A))))),

    which further simplifies, rewriting with CAR-CONS, CDR-CONS,
    FALSIFY1-EXTENDS-MODELS, and ASSIGNMENT-IMPLIES-ASSIGNED, and
    expanding the functions ASSUME-FALSE, ASSIGNEDP, ASSIGNMENT,
    EQUAL, IF-EXPRP, FALSIFY1, and VALUE, to:

          T.

  Case 26.1.
          (IMPLIES (AND (IF-EXPRP X)
			(ASSIGNEDP (TEST X) A)
			(NOT (ASSIGNMENT (TEST X) A))
			(ASSIGNMENT (TEST X)
				    (FALSIFY1 (RIGHT-BRANCH X) A))
			(NOT (VALUE (TEST X)
				    (FALSIFY1 (TEST X) A)))
			(NOT (VALUE (LEFT-BRANCH X)
				    (FALSIFY1 (LEFT-BRANCH X) A)))
			(NOT (FALSIFY1 (LEFT-BRANCH X)
				       (ASSUME-TRUE (TEST X) A)))
			(NOT (IF-EXPRP (TEST X)))
			(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
			(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
			(FALSIFY1 (RIGHT-BRANCH X) A))
		   (NOT (VALUE X
			       (FALSIFY1 (RIGHT-BRANCH X) A)))).

    However this simplifies again, rewriting with the lemma
    FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 25.(IMPLIES (AND (IF-EXPRP X)
		      (VALUE (TEST X) (FALSIFY1 X A))
		      (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		      (NOT (NORMALIZED-IF-EXPRP (LEFT-BRANCH X)))
		      (NORMALIZED-IF-EXPRP X)
		      (FALSIFY1 X A))
		 (NOT (VALUE X (FALSIFY1 X A)))).

  This simplifies, appealing to the lemma VALUE-SHORT-CUT, and
  unfolding the definitions of FALSIFY1 and NORMALIZED-IF-EXPRP, to:

        T.

Case 24.(IMPLIES (AND (IF-EXPRP X)
		      (VALUE (TEST X) (FALSIFY1 X A))
		      (NOT (FALSIFY1 (TEST X) A))
		      (NOT (NORMALIZED-IF-EXPRP (LEFT-BRANCH X)))
		      (NORMALIZED-IF-EXPRP X)
		      (FALSIFY1 X A))
		 (NOT (VALUE X (FALSIFY1 X A)))),

  which simplifies, applying the lemma VALUE-SHORT-CUT, and unfolding
  the definitions of FALSIFY1 and NORMALIZED-IF-EXPRP, to:

        T.

Case 23.(IMPLIES (AND (IF-EXPRP X)
		      (VALUE (TEST X) (FALSIFY1 X A))
		      (NOT (VALUE (TEST X)
				  (FALSIFY1 (TEST X) A)))
		      (NOT (NORMALIZED-IF-EXPRP (LEFT-BRANCH X)))
		      (NORMALIZED-IF-EXPRP X)
		      (FALSIFY1 X A))
		 (NOT (VALUE X (FALSIFY1 X A)))).

  This simplifies, rewriting with the lemma VALUE-SHORT-CUT, and
  unfolding the definitions of FALSIFY1 and NORMALIZED-IF-EXPRP, to:

        T.

Case 22.(IMPLIES
		(AND (IF-EXPRP X)
		     (VALUE (TEST X) (FALSIFY1 X A))
		     (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		     (NOT (FALSIFY1 (LEFT-BRANCH X) A))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		     (NORMALIZED-IF-EXPRP X)
		     (FALSIFY1 X A))
		(NOT (VALUE X (FALSIFY1 X A)))),

  which simplifies, rewriting with VALUE-SHORT-CUT and
  ASSIGNMENT-IMPLIES-ASSIGNED, and opening up FALSIFY1,
  NORMALIZED-IF-EXPRP, and VALUE, to two new conjectures:

  Case 22.2.
          (IMPLIES
		(AND (IF-EXPRP X)
		     (NOT (ASSIGNEDP (TEST X) A))
		     (NOT (FALSIFY1 (LEFT-BRANCH X)
				    (ASSUME-TRUE (TEST X) A)))
		     (ASSIGNMENT (TEST X)
				 (FALSIFY1 (RIGHT-BRANCH X)
					   (ASSUME-FALSE (TEST X) A)))
		     (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		     (NOT (FALSIFY1 (LEFT-BRANCH X) A))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		     (NOT (IF-EXPRP (TEST X)))
		     (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		     (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		     (FALSIFY1 (RIGHT-BRANCH X)
			       (ASSUME-FALSE (TEST X) A)))
		(NOT (VALUE X
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A))))).

    This further simplifies, applying CAR-CONS, CDR-CONS, and
    FALSIFY1-EXTENDS-MODELS, and unfolding the definitions of
    ASSUME-TRUE, ASSUME-FALSE, ASSIGNEDP, ASSIGNMENT, and
    NORMALIZED-IF-EXPRP, to:

          T.

  Case 22.1.
          (IMPLIES
		(AND (IF-EXPRP X)
		     (ASSIGNEDP (TEST X) A)
		     (NOT (ASSIGNMENT (TEST X) A))
		     (ASSIGNMENT (TEST X)
				 (FALSIFY1 (RIGHT-BRANCH X) A))
		     (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		     (NOT (FALSIFY1 (LEFT-BRANCH X) A))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		     (NOT (IF-EXPRP (TEST X)))
		     (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		     (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		     (FALSIFY1 (RIGHT-BRANCH X) A))
		(NOT (VALUE X
			    (FALSIFY1 (RIGHT-BRANCH X) A)))).

    But this again simplifies, appealing to the lemma
    FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 21.(IMPLIES
		(AND (IF-EXPRP X)
		     (VALUE (TEST X) (FALSIFY1 X A))
		     (NOT (FALSIFY1 (TEST X) A))
		     (NOT (FALSIFY1 (LEFT-BRANCH X) A))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		     (NORMALIZED-IF-EXPRP X)
		     (FALSIFY1 X A))
		(NOT (VALUE X (FALSIFY1 X A)))).

  This simplifies, rewriting with VALUE-SHORT-CUT and
  ASSIGNMENT-IMPLIES-ASSIGNED, and unfolding the definitions of
  FALSIFY1, NORMALIZED-IF-EXPRP, and VALUE, to two new conjectures:

  Case 21.2.
          (IMPLIES
		(AND (IF-EXPRP X)
		     (NOT (ASSIGNEDP (TEST X) A))
		     (NOT (FALSIFY1 (LEFT-BRANCH X)
				    (ASSUME-TRUE (TEST X) A)))
		     (ASSIGNMENT (TEST X)
				 (FALSIFY1 (RIGHT-BRANCH X)
					   (ASSUME-FALSE (TEST X) A)))
		     (NOT (FALSIFY1 (TEST X) A))
		     (NOT (FALSIFY1 (LEFT-BRANCH X) A))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		     (NOT (IF-EXPRP (TEST X)))
		     (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		     (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		     (FALSIFY1 (RIGHT-BRANCH X)
			       (ASSUME-FALSE (TEST X) A)))
		(NOT (VALUE X
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A))))).

    But this further simplifies, rewriting with the lemmas CAR-CONS,
    CDR-CONS, FALSIFY1-EXTENDS-MODELS, and
    ASSIGNMENT-IMPLIES-ASSIGNED, and unfolding the functions
    ASSUME-TRUE, ASSUME-FALSE, ASSIGNEDP, ASSIGNMENT, EQUAL, IF-EXPRP,
    FALSIFY1, and CONS, to:

          (IMPLIES
	     (AND (IF-EXPRP X)
		  (NOT (ASSIGNEDP (TEST X) A))
		  (NOT (FALSIFY1 (LEFT-BRANCH X)
				 (CONS (CONS (TEST X) T) A)))
		  (EQUAL (TEST X) T)
		  (NOT (FALSIFY1 (LEFT-BRANCH X) A))
		  (NOT (VALUE (LEFT-BRANCH X)
			      (FALSIFY1 (LEFT-BRANCH X)
					(CONS '(1TRUE . 1TRUE) A))))
		  (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		  (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		  (FALSIFY1 (RIGHT-BRANCH X)
			    (CONS '(1TRUE . 1FALSE) A)))
	     (NOT (VALUE X
			 (FALSIFY1 (RIGHT-BRANCH X)
				   (CONS '(1TRUE . 1FALSE) A))))),

    which again simplifies, applying ASSIGNMENT-IMPLIES-ASSIGNED, and
    unfolding the definitions of ASSIGNMENT and EQUAL, to:

          T.

  Case 21.1.
          (IMPLIES
		(AND (IF-EXPRP X)
		     (ASSIGNEDP (TEST X) A)
		     (NOT (ASSIGNMENT (TEST X) A))
		     (ASSIGNMENT (TEST X)
				 (FALSIFY1 (RIGHT-BRANCH X) A))
		     (NOT (FALSIFY1 (TEST X) A))
		     (NOT (FALSIFY1 (LEFT-BRANCH X) A))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		     (NOT (IF-EXPRP (TEST X)))
		     (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		     (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		     (FALSIFY1 (RIGHT-BRANCH X) A))
		(NOT (VALUE X
			    (FALSIFY1 (RIGHT-BRANCH X) A)))).

    However this simplifies again, appealing to the lemma
    FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 20.(IMPLIES
		(AND (IF-EXPRP X)
		     (VALUE (TEST X) (FALSIFY1 X A))
		     (NOT (VALUE (TEST X)
				 (FALSIFY1 (TEST X) A)))
		     (NOT (FALSIFY1 (LEFT-BRANCH X) A))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		     (NORMALIZED-IF-EXPRP X)
		     (FALSIFY1 X A))
		(NOT (VALUE X (FALSIFY1 X A)))).

  This simplifies, applying VALUE-SHORT-CUT and
  ASSIGNMENT-IMPLIES-ASSIGNED, and unfolding FALSIFY1,
  NORMALIZED-IF-EXPRP, and VALUE, to the following two new
  conjectures:

  Case 20.2.
          (IMPLIES
		(AND (IF-EXPRP X)
		     (NOT (ASSIGNEDP (TEST X) A))
		     (NOT (FALSIFY1 (LEFT-BRANCH X)
				    (ASSUME-TRUE (TEST X) A)))
		     (ASSIGNMENT (TEST X)
				 (FALSIFY1 (RIGHT-BRANCH X)
					   (ASSUME-FALSE (TEST X) A)))
		     (NOT (VALUE (TEST X)
				 (FALSIFY1 (TEST X) A)))
		     (NOT (FALSIFY1 (LEFT-BRANCH X) A))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		     (NOT (IF-EXPRP (TEST X)))
		     (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		     (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		     (FALSIFY1 (RIGHT-BRANCH X)
			       (ASSUME-FALSE (TEST X) A)))
		(NOT (VALUE X
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A))))).

    But this further simplifies, rewriting with CAR-CONS, CDR-CONS,
    FALSIFY1-EXTENDS-MODELS, and ASSIGNMENT-IMPLIES-ASSIGNED, and
    unfolding the functions ASSUME-TRUE, ASSUME-FALSE, ASSIGNEDP,
    ASSIGNMENT, EQUAL, IF-EXPRP, FALSIFY1, and VALUE, to:

          T.

  Case 20.1.
          (IMPLIES
		(AND (IF-EXPRP X)
		     (ASSIGNEDP (TEST X) A)
		     (NOT (ASSIGNMENT (TEST X) A))
		     (ASSIGNMENT (TEST X)
				 (FALSIFY1 (RIGHT-BRANCH X) A))
		     (NOT (VALUE (TEST X)
				 (FALSIFY1 (TEST X) A)))
		     (NOT (FALSIFY1 (LEFT-BRANCH X) A))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		     (NOT (IF-EXPRP (TEST X)))
		     (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		     (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		     (FALSIFY1 (RIGHT-BRANCH X) A))
		(NOT (VALUE X
			    (FALSIFY1 (RIGHT-BRANCH X) A)))),

    which we again simplify, rewriting with FALSIFY1-EXTENDS-MODELS,
    to:

          T.

Case 19.(IMPLIES
		(AND (IF-EXPRP X)
		     (VALUE (TEST X) (FALSIFY1 X A))
		     (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X) A)))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		     (NORMALIZED-IF-EXPRP X)
		     (FALSIFY1 X A))
		(NOT (VALUE X (FALSIFY1 X A)))),

  which we simplify, applying VALUE-SHORT-CUT,
  ASSIGNMENT-IMPLIES-ASSIGNED, and FALSIFY1-EXTENDS-MODELS, and
  unfolding the functions FALSIFY1, NORMALIZED-IF-EXPRP, and VALUE,
  to the following two new conjectures:

  Case 19.2.
          (IMPLIES
		(AND (IF-EXPRP X)
		     (NOT (ASSIGNEDP (TEST X) A))
		     (NOT (FALSIFY1 (LEFT-BRANCH X)
				    (ASSUME-TRUE (TEST X) A)))
		     (ASSIGNMENT (TEST X)
				 (FALSIFY1 (RIGHT-BRANCH X)
					   (ASSUME-FALSE (TEST X) A)))
		     (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X) A)))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		     (NOT (IF-EXPRP (TEST X)))
		     (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		     (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		     (FALSIFY1 (RIGHT-BRANCH X)
			       (ASSUME-FALSE (TEST X) A)))
		(NOT (VALUE X
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A))))).

    But this further simplifies, rewriting with CAR-CONS, CDR-CONS,
    and FALSIFY1-EXTENDS-MODELS, and expanding the functions
    ASSUME-TRUE, ASSUME-FALSE, ASSIGNEDP, ASSIGNMENT, and
    NORMALIZED-IF-EXPRP, to:

          T.

  Case 19.1.
          (IMPLIES
		(AND (IF-EXPRP X)
		     (ASSIGNEDP (TEST X) A)
		     (NOT (ASSIGNMENT (TEST X) A))
		     (ASSIGNMENT (TEST X)
				 (FALSIFY1 (RIGHT-BRANCH X) A))
		     (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X) A)))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		     (NOT (IF-EXPRP (TEST X)))
		     (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		     (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		     (FALSIFY1 (RIGHT-BRANCH X) A))
		(NOT (VALUE X
			    (FALSIFY1 (RIGHT-BRANCH X) A)))),

    which again simplifies, rewriting with FALSIFY1-EXTENDS-MODELS,
    to:

          T.

Case 18.(IMPLIES
		(AND (IF-EXPRP X)
		     (VALUE (TEST X) (FALSIFY1 X A))
		     (NOT (FALSIFY1 (TEST X) A))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X) A)))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		     (NORMALIZED-IF-EXPRP X)
		     (FALSIFY1 X A))
		(NOT (VALUE X (FALSIFY1 X A)))).

  This simplifies, applying VALUE-SHORT-CUT,
  ASSIGNMENT-IMPLIES-ASSIGNED, and FALSIFY1-EXTENDS-MODELS, and
  unfolding the definitions of FALSIFY1, NORMALIZED-IF-EXPRP, and
  VALUE, to two new goals:

  Case 18.2.
          (IMPLIES
		(AND (IF-EXPRP X)
		     (NOT (ASSIGNEDP (TEST X) A))
		     (NOT (FALSIFY1 (LEFT-BRANCH X)
				    (ASSUME-TRUE (TEST X) A)))
		     (ASSIGNMENT (TEST X)
				 (FALSIFY1 (RIGHT-BRANCH X)
					   (ASSUME-FALSE (TEST X) A)))
		     (NOT (FALSIFY1 (TEST X) A))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X) A)))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		     (NOT (IF-EXPRP (TEST X)))
		     (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		     (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		     (FALSIFY1 (RIGHT-BRANCH X)
			       (ASSUME-FALSE (TEST X) A)))
		(NOT (VALUE X
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A))))),

    which further simplifies, applying CAR-CONS, CDR-CONS,
    FALSIFY1-EXTENDS-MODELS, and ASSIGNMENT-IMPLIES-ASSIGNED, and
    expanding the definitions of ASSUME-TRUE, ASSUME-FALSE, ASSIGNEDP,
    ASSIGNMENT, EQUAL, IF-EXPRP, FALSIFY1, and CONS, to:

          (IMPLIES
	     (AND (IF-EXPRP X)
		  (NOT (ASSIGNEDP (TEST X) A))
		  (NOT (FALSIFY1 (LEFT-BRANCH X)
				 (CONS (CONS (TEST X) T) A)))
		  (EQUAL (TEST X) T)
		  (NOT (VALUE (LEFT-BRANCH X)
			      (FALSIFY1 (LEFT-BRANCH X) A)))
		  (NOT (VALUE (LEFT-BRANCH X)
			      (FALSIFY1 (LEFT-BRANCH X)
					(CONS '(1TRUE . 1TRUE) A))))
		  (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		  (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		  (FALSIFY1 (RIGHT-BRANCH X)
			    (CONS '(1TRUE . 1FALSE) A)))
	     (NOT (VALUE X
			 (FALSIFY1 (RIGHT-BRANCH X)
				   (CONS '(1TRUE . 1FALSE) A))))),

    which again simplifies, rewriting with
    ASSIGNMENT-IMPLIES-ASSIGNED, and unfolding the definitions of
    ASSIGNMENT and EQUAL, to:

          T.

  Case 18.1.
          (IMPLIES
		(AND (IF-EXPRP X)
		     (ASSIGNEDP (TEST X) A)
		     (NOT (ASSIGNMENT (TEST X) A))
		     (ASSIGNMENT (TEST X)
				 (FALSIFY1 (RIGHT-BRANCH X) A))
		     (NOT (FALSIFY1 (TEST X) A))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X) A)))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		     (NOT (IF-EXPRP (TEST X)))
		     (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		     (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		     (FALSIFY1 (RIGHT-BRANCH X) A))
		(NOT (VALUE X
			    (FALSIFY1 (RIGHT-BRANCH X) A)))).

    However this again simplifies, rewriting with
    FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 17.(IMPLIES
		(AND (IF-EXPRP X)
		     (VALUE (TEST X) (FALSIFY1 X A))
		     (NOT (VALUE (TEST X)
				 (FALSIFY1 (TEST X) A)))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X) A)))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		     (NORMALIZED-IF-EXPRP X)
		     (FALSIFY1 X A))
		(NOT (VALUE X (FALSIFY1 X A)))),

  which we simplify, applying the lemmas VALUE-SHORT-CUT,
  ASSIGNMENT-IMPLIES-ASSIGNED, and FALSIFY1-EXTENDS-MODELS, and
  opening up the functions FALSIFY1, NORMALIZED-IF-EXPRP, and VALUE,
  to two new conjectures:

  Case 17.2.
          (IMPLIES
		(AND (IF-EXPRP X)
		     (NOT (ASSIGNEDP (TEST X) A))
		     (NOT (FALSIFY1 (LEFT-BRANCH X)
				    (ASSUME-TRUE (TEST X) A)))
		     (ASSIGNMENT (TEST X)
				 (FALSIFY1 (RIGHT-BRANCH X)
					   (ASSUME-FALSE (TEST X) A)))
		     (NOT (VALUE (TEST X)
				 (FALSIFY1 (TEST X) A)))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X) A)))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		     (NOT (IF-EXPRP (TEST X)))
		     (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		     (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		     (FALSIFY1 (RIGHT-BRANCH X)
			       (ASSUME-FALSE (TEST X) A)))
		(NOT (VALUE X
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A))))).

    But this simplifies further, rewriting with the lemmas CAR-CONS,
    CDR-CONS, FALSIFY1-EXTENDS-MODELS, and
    ASSIGNMENT-IMPLIES-ASSIGNED, and expanding the functions
    ASSUME-TRUE, ASSUME-FALSE, ASSIGNEDP, ASSIGNMENT, EQUAL, IF-EXPRP,
    FALSIFY1, and VALUE, to:

          T.

  Case 17.1.
          (IMPLIES
		(AND (IF-EXPRP X)
		     (ASSIGNEDP (TEST X) A)
		     (NOT (ASSIGNMENT (TEST X) A))
		     (ASSIGNMENT (TEST X)
				 (FALSIFY1 (RIGHT-BRANCH X) A))
		     (NOT (VALUE (TEST X)
				 (FALSIFY1 (TEST X) A)))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X) A)))
		     (NOT (VALUE (LEFT-BRANCH X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		     (NOT (IF-EXPRP (TEST X)))
		     (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		     (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		     (FALSIFY1 (RIGHT-BRANCH X) A))
		(NOT (VALUE X
			    (FALSIFY1 (RIGHT-BRANCH X) A)))).

    This simplifies again, applying the lemma FALSIFY1-EXTENDS-MODELS,
    to:

          T.

Case 16.(IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (FALSIFY1 X A)))
		      (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		      (NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		      (NOT (FALSIFY1 (RIGHT-BRANCH X)
				     (ASSUME-FALSE (TEST X) A)))
		      (NORMALIZED-IF-EXPRP X)
		      (FALSIFY1 X A))
		 (NOT (VALUE X (FALSIFY1 X A)))).

  This simplifies, rewriting with the lemmas VALUE-SHORT-CUT and
  ASSIGNMENT-IMPLIES-ASSIGNED, and unfolding FALSIFY1 and
  NORMALIZED-IF-EXPRP, to two new goals:

  Case 16.2.
          (IMPLIES
	   (AND (IF-EXPRP X)
		(NOT (ASSIGNEDP (TEST X) A))
		(NOT (ASSIGNMENT (TEST X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		(NOT (NORMALIZED-IF-EXPRP (TEST X)))
		(NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		(NOT (FALSIFY1 (RIGHT-BRANCH X)
			       (ASSUME-FALSE (TEST X) A)))
		(NOT (IF-EXPRP (TEST X)))
		(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		(FALSIFY1 (LEFT-BRANCH X)
			  (ASSUME-TRUE (TEST X) A)))
	   (NOT (VALUE X
		       (FALSIFY1 (LEFT-BRANCH X)
				 (ASSUME-TRUE (TEST X) A))))).

    However this simplifies further, rewriting with CAR-CONS,
    CDR-CONS, and FALSIFY1-EXTENDS-MODELS, and unfolding ASSUME-TRUE,
    ASSIGNEDP, ASSIGNMENT, and NORMALIZED-IF-EXPRP, to:

          T.

  Case 16.1.
          (IMPLIES
		  (AND (IF-EXPRP X)
		       (ASSIGNEDP (TEST X) A)
		       (ASSIGNMENT (TEST X) A)
		       (NOT (ASSIGNMENT (TEST X)
					(FALSIFY1 (LEFT-BRANCH X) A)))
		       (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		       (NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		       (NOT (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A)))
		       (NOT (IF-EXPRP (TEST X)))
		       (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		       (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		       (FALSIFY1 (LEFT-BRANCH X) A))
		  (NOT (VALUE X
			      (FALSIFY1 (LEFT-BRANCH X) A)))).

    This again simplifies, rewriting with the lemmas
    ASSIGNMENT-IMPLIES-ASSIGNED and FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 15.(IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (FALSIFY1 X A)))
		      (NOT (FALSIFY1 (TEST X) A))
		      (NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		      (NOT (FALSIFY1 (RIGHT-BRANCH X)
				     (ASSUME-FALSE (TEST X) A)))
		      (NORMALIZED-IF-EXPRP X)
		      (FALSIFY1 X A))
		 (NOT (VALUE X (FALSIFY1 X A)))),

  which we simplify, applying VALUE-SHORT-CUT and
  ASSIGNMENT-IMPLIES-ASSIGNED, and expanding the definitions of
  FALSIFY1 and NORMALIZED-IF-EXPRP, to the following two new goals:

  Case 15.2.
          (IMPLIES
	   (AND (IF-EXPRP X)
		(NOT (ASSIGNEDP (TEST X) A))
		(NOT (ASSIGNMENT (TEST X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		(NOT (FALSIFY1 (TEST X) A))
		(NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		(NOT (FALSIFY1 (RIGHT-BRANCH X)
			       (ASSUME-FALSE (TEST X) A)))
		(NOT (IF-EXPRP (TEST X)))
		(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		(FALSIFY1 (LEFT-BRANCH X)
			  (ASSUME-TRUE (TEST X) A)))
	   (NOT (VALUE X
		       (FALSIFY1 (LEFT-BRANCH X)
				 (ASSUME-TRUE (TEST X) A))))),

    which we further simplify, applying CAR-CONS, CDR-CONS, and
    FALSIFY1-EXTENDS-MODELS, and unfolding the functions ASSUME-TRUE,
    ASSIGNEDP, ASSIGNMENT, EQUAL, IF-EXPRP, FALSIFY1, and
    ASSUME-FALSE, to:

          (IMPLIES
	   (AND (IF-EXPRP X)
		(NOT (ASSIGNEDP (TEST X) A))
		(NOT (EQUAL (TEST X) T))
		(NOT (TEST X))
		(NOT A)
		(NOT (FALSIFY1 (RIGHT-BRANCH X) F))
		(NOT (FALSIFY1 (RIGHT-BRANCH X)
			       '((1FALSE . 1FALSE) . 1FALSE)))
		(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		(FALSIFY1 (LEFT-BRANCH X)
			  '((1FALSE . 1TRUE) . 1FALSE)))
	   (NOT (VALUE X
		       (FALSIFY1 (LEFT-BRANCH X)
				 '((1FALSE . 1TRUE) . 1FALSE))))).

    However this simplifies again, expanding ASSIGNEDP, to:

          T.

  Case 15.1.
          (IMPLIES
		  (AND (IF-EXPRP X)
		       (ASSIGNEDP (TEST X) A)
		       (ASSIGNMENT (TEST X) A)
		       (NOT (ASSIGNMENT (TEST X)
					(FALSIFY1 (LEFT-BRANCH X) A)))
		       (NOT (FALSIFY1 (TEST X) A))
		       (NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		       (NOT (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A)))
		       (NOT (IF-EXPRP (TEST X)))
		       (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		       (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		       (FALSIFY1 (LEFT-BRANCH X) A))
		  (NOT (VALUE X
			      (FALSIFY1 (LEFT-BRANCH X) A)))),

    which we again simplify, applying the lemmas
    ASSIGNMENT-IMPLIES-ASSIGNED and FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 14.(IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (FALSIFY1 X A)))
		      (NOT (VALUE (TEST X)
				  (FALSIFY1 (TEST X) A)))
		      (NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		      (NOT (FALSIFY1 (RIGHT-BRANCH X)
				     (ASSUME-FALSE (TEST X) A)))
		      (NORMALIZED-IF-EXPRP X)
		      (FALSIFY1 X A))
		 (NOT (VALUE X (FALSIFY1 X A)))).

  This simplifies, rewriting with VALUE-SHORT-CUT and
  ASSIGNMENT-IMPLIES-ASSIGNED, and expanding FALSIFY1 and
  NORMALIZED-IF-EXPRP, to two new formulas:

  Case 14.2.
          (IMPLIES
	   (AND (IF-EXPRP X)
		(NOT (ASSIGNEDP (TEST X) A))
		(NOT (ASSIGNMENT (TEST X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		(NOT (VALUE (TEST X)
			    (FALSIFY1 (TEST X) A)))
		(NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		(NOT (FALSIFY1 (RIGHT-BRANCH X)
			       (ASSUME-FALSE (TEST X) A)))
		(NOT (IF-EXPRP (TEST X)))
		(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		(FALSIFY1 (LEFT-BRANCH X)
			  (ASSUME-TRUE (TEST X) A)))
	   (NOT (VALUE X
		       (FALSIFY1 (LEFT-BRANCH X)
				 (ASSUME-TRUE (TEST X) A))))).

    But this simplifies further, applying the lemmas CAR-CONS,
    CDR-CONS, FALSIFY1-EXTENDS-MODELS, and VALUE-SHORT-CUT, and
    opening up the functions ASSUME-TRUE, ASSIGNEDP, ASSIGNMENT,
    EQUAL, IF-EXPRP, FALSIFY1, VALUE, CONS, ASSUME-FALSE, and
    NORMALIZED-IF-EXPRP, to the conjecture:

          (IMPLIES
	       (AND (IF-EXPRP X)
		    (NOT (ASSIGNEDP (TEST X) A))
		    (NOT (EQUAL (TEST X) T))
		    (NOT (TEST X))
		    (NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		    (NOT (FALSIFY1 (RIGHT-BRANCH X)
				   (CONS '(1FALSE . 1FALSE) A)))
		    (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		    (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		    (FALSIFY1 (LEFT-BRANCH X)
			      (CONS '(1FALSE . 1TRUE) A)))
	       (NOT (VALUE X
			   (FALSIFY1 (LEFT-BRANCH X)
				     (CONS '(1FALSE . 1TRUE) A))))),

    which we again simplify, opening up the definitions of EQUAL and
    ASSIGNEDP, to:

          T.

  Case 14.1.
          (IMPLIES
		  (AND (IF-EXPRP X)
		       (ASSIGNEDP (TEST X) A)
		       (ASSIGNMENT (TEST X) A)
		       (NOT (ASSIGNMENT (TEST X)
					(FALSIFY1 (LEFT-BRANCH X) A)))
		       (NOT (VALUE (TEST X)
				   (FALSIFY1 (TEST X) A)))
		       (NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		       (NOT (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A)))
		       (NOT (IF-EXPRP (TEST X)))
		       (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		       (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		       (FALSIFY1 (LEFT-BRANCH X) A))
		  (NOT (VALUE X
			      (FALSIFY1 (LEFT-BRANCH X) A)))).

    But this again simplifies, rewriting with the lemmas
    ASSIGNMENT-IMPLIES-ASSIGNED and FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 13.(IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (FALSIFY1 X A)))
		      (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		      (NOT (VALUE (RIGHT-BRANCH X)
				  (FALSIFY1 (RIGHT-BRANCH X) A)))
		      (NOT (FALSIFY1 (RIGHT-BRANCH X)
				     (ASSUME-FALSE (TEST X) A)))
		      (NORMALIZED-IF-EXPRP X)
		      (FALSIFY1 X A))
		 (NOT (VALUE X (FALSIFY1 X A)))).

  This simplifies, applying the lemmas VALUE-SHORT-CUT,
  ASSIGNMENT-IMPLIES-ASSIGNED, and FALSIFY1-EXTENDS-MODELS, and
  expanding the functions FALSIFY1, NORMALIZED-IF-EXPRP, and VALUE,
  to two new formulas:

  Case 13.2.
          (IMPLIES
	   (AND (IF-EXPRP X)
		(NOT (ASSIGNEDP (TEST X) A))
		(NOT (ASSIGNMENT (TEST X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		(NOT (NORMALIZED-IF-EXPRP (TEST X)))
		(NOT (VALUE (RIGHT-BRANCH X)
			    (FALSIFY1 (RIGHT-BRANCH X) A)))
		(NOT (FALSIFY1 (RIGHT-BRANCH X)
			       (ASSUME-FALSE (TEST X) A)))
		(NOT (IF-EXPRP (TEST X)))
		(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		(FALSIFY1 (LEFT-BRANCH X)
			  (ASSUME-TRUE (TEST X) A)))
	   (NOT (VALUE X
		       (FALSIFY1 (LEFT-BRANCH X)
				 (ASSUME-TRUE (TEST X) A))))),

    which further simplifies, rewriting with CAR-CONS, CDR-CONS, and
    FALSIFY1-EXTENDS-MODELS, and unfolding the functions ASSUME-TRUE,
    ASSIGNEDP, ASSIGNMENT, and NORMALIZED-IF-EXPRP, to:

          T.

  Case 13.1.
          (IMPLIES
		  (AND (IF-EXPRP X)
		       (ASSIGNEDP (TEST X) A)
		       (ASSIGNMENT (TEST X) A)
		       (NOT (ASSIGNMENT (TEST X)
					(FALSIFY1 (LEFT-BRANCH X) A)))
		       (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		       (NOT (VALUE (RIGHT-BRANCH X)
				   (FALSIFY1 (RIGHT-BRANCH X) A)))
		       (NOT (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A)))
		       (NOT (IF-EXPRP (TEST X)))
		       (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		       (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		       (FALSIFY1 (LEFT-BRANCH X) A))
		  (NOT (VALUE X
			      (FALSIFY1 (LEFT-BRANCH X) A)))),

    which we again simplify, applying ASSIGNMENT-IMPLIES-ASSIGNED and
    FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 12.(IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (FALSIFY1 X A)))
		      (NOT (FALSIFY1 (TEST X) A))
		      (NOT (VALUE (RIGHT-BRANCH X)
				  (FALSIFY1 (RIGHT-BRANCH X) A)))
		      (NOT (FALSIFY1 (RIGHT-BRANCH X)
				     (ASSUME-FALSE (TEST X) A)))
		      (NORMALIZED-IF-EXPRP X)
		      (FALSIFY1 X A))
		 (NOT (VALUE X (FALSIFY1 X A)))),

  which simplifies, appealing to the lemmas VALUE-SHORT-CUT,
  ASSIGNMENT-IMPLIES-ASSIGNED, and FALSIFY1-EXTENDS-MODELS, and
  expanding the definitions of FALSIFY1, NORMALIZED-IF-EXPRP, and
  VALUE, to the following two new goals:

  Case 12.2.
          (IMPLIES
	   (AND (IF-EXPRP X)
		(NOT (ASSIGNEDP (TEST X) A))
		(NOT (ASSIGNMENT (TEST X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		(NOT (FALSIFY1 (TEST X) A))
		(NOT (VALUE (RIGHT-BRANCH X)
			    (FALSIFY1 (RIGHT-BRANCH X) A)))
		(NOT (FALSIFY1 (RIGHT-BRANCH X)
			       (ASSUME-FALSE (TEST X) A)))
		(NOT (IF-EXPRP (TEST X)))
		(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		(FALSIFY1 (LEFT-BRANCH X)
			  (ASSUME-TRUE (TEST X) A)))
	   (NOT (VALUE X
		       (FALSIFY1 (LEFT-BRANCH X)
				 (ASSUME-TRUE (TEST X) A))))).

    However this simplifies further, applying the lemmas CAR-CONS,
    CDR-CONS, and FALSIFY1-EXTENDS-MODELS, and expanding the
    functions ASSUME-TRUE, ASSIGNEDP, ASSIGNMENT, EQUAL, IF-EXPRP,
    FALSIFY1, and ASSUME-FALSE, to the new formula:

          (IMPLIES
	   (AND (IF-EXPRP X)
		(NOT (ASSIGNEDP (TEST X) A))
		(NOT (EQUAL (TEST X) T))
		(NOT (TEST X))
		(NOT A)
		(NOT (VALUE (RIGHT-BRANCH X)
			    (FALSIFY1 (RIGHT-BRANCH X) F)))
		(NOT (FALSIFY1 (RIGHT-BRANCH X)
			       '((1FALSE . 1FALSE) . 1FALSE)))
		(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		(FALSIFY1 (LEFT-BRANCH X)
			  '((1FALSE . 1TRUE) . 1FALSE)))
	   (NOT (VALUE X
		       (FALSIFY1 (LEFT-BRANCH X)
				 '((1FALSE . 1TRUE) . 1FALSE))))),

    which again simplifies, unfolding the definition of ASSIGNEDP, to:

          T.

  Case 12.1.
          (IMPLIES
		  (AND (IF-EXPRP X)
		       (ASSIGNEDP (TEST X) A)
		       (ASSIGNMENT (TEST X) A)
		       (NOT (ASSIGNMENT (TEST X)
					(FALSIFY1 (LEFT-BRANCH X) A)))
		       (NOT (FALSIFY1 (TEST X) A))
		       (NOT (VALUE (RIGHT-BRANCH X)
				   (FALSIFY1 (RIGHT-BRANCH X) A)))
		       (NOT (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A)))
		       (NOT (IF-EXPRP (TEST X)))
		       (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		       (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		       (FALSIFY1 (LEFT-BRANCH X) A))
		  (NOT (VALUE X
			      (FALSIFY1 (LEFT-BRANCH X) A)))).

    However this simplifies again, rewriting with
    ASSIGNMENT-IMPLIES-ASSIGNED and FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 11.(IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (FALSIFY1 X A)))
		      (NOT (VALUE (TEST X)
				  (FALSIFY1 (TEST X) A)))
		      (NOT (VALUE (RIGHT-BRANCH X)
				  (FALSIFY1 (RIGHT-BRANCH X) A)))
		      (NOT (FALSIFY1 (RIGHT-BRANCH X)
				     (ASSUME-FALSE (TEST X) A)))
		      (NORMALIZED-IF-EXPRP X)
		      (FALSIFY1 X A))
		 (NOT (VALUE X (FALSIFY1 X A)))),

  which we simplify, applying VALUE-SHORT-CUT,
  ASSIGNMENT-IMPLIES-ASSIGNED, and FALSIFY1-EXTENDS-MODELS, and
  expanding FALSIFY1, NORMALIZED-IF-EXPRP, and VALUE, to the
  following two new conjectures:

  Case 11.2.
          (IMPLIES
	   (AND (IF-EXPRP X)
		(NOT (ASSIGNEDP (TEST X) A))
		(NOT (ASSIGNMENT (TEST X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		(NOT (VALUE (TEST X)
			    (FALSIFY1 (TEST X) A)))
		(NOT (VALUE (RIGHT-BRANCH X)
			    (FALSIFY1 (RIGHT-BRANCH X) A)))
		(NOT (FALSIFY1 (RIGHT-BRANCH X)
			       (ASSUME-FALSE (TEST X) A)))
		(NOT (IF-EXPRP (TEST X)))
		(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		(FALSIFY1 (LEFT-BRANCH X)
			  (ASSUME-TRUE (TEST X) A)))
	   (NOT (VALUE X
		       (FALSIFY1 (LEFT-BRANCH X)
				 (ASSUME-TRUE (TEST X) A))))),

    which we further simplify, appealing to the lemmas CAR-CONS,
    CDR-CONS, FALSIFY1-EXTENDS-MODELS, and VALUE-SHORT-CUT, and
    expanding the functions ASSUME-TRUE, ASSIGNEDP, ASSIGNMENT, EQUAL,
    IF-EXPRP, FALSIFY1, VALUE, CONS, ASSUME-FALSE, and
    NORMALIZED-IF-EXPRP, to:

          (IMPLIES
	       (AND (IF-EXPRP X)
		    (NOT (ASSIGNEDP (TEST X) A))
		    (NOT (EQUAL (TEST X) T))
		    (NOT (TEST X))
		    (NOT (VALUE (RIGHT-BRANCH X)
				(FALSIFY1 (RIGHT-BRANCH X) A)))
		    (NOT (FALSIFY1 (RIGHT-BRANCH X)
				   (CONS '(1FALSE . 1FALSE) A)))
		    (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		    (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		    (FALSIFY1 (LEFT-BRANCH X)
			      (CONS '(1FALSE . 1TRUE) A)))
	       (NOT (VALUE X
			   (FALSIFY1 (LEFT-BRANCH X)
				     (CONS '(1FALSE . 1TRUE) A))))).

    However this simplifies again, expanding the functions EQUAL and
    ASSIGNEDP, to:

          T.

  Case 11.1.
          (IMPLIES
		  (AND (IF-EXPRP X)
		       (ASSIGNEDP (TEST X) A)
		       (ASSIGNMENT (TEST X) A)
		       (NOT (ASSIGNMENT (TEST X)
					(FALSIFY1 (LEFT-BRANCH X) A)))
		       (NOT (VALUE (TEST X)
				   (FALSIFY1 (TEST X) A)))
		       (NOT (VALUE (RIGHT-BRANCH X)
				   (FALSIFY1 (RIGHT-BRANCH X) A)))
		       (NOT (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A)))
		       (NOT (IF-EXPRP (TEST X)))
		       (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		       (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		       (FALSIFY1 (LEFT-BRANCH X) A))
		  (NOT (VALUE X
			      (FALSIFY1 (LEFT-BRANCH X) A)))).

    This again simplifies, rewriting with ASSIGNMENT-IMPLIES-ASSIGNED
    and FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 10.(IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (FALSIFY1 X A)))
		      (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		      (NOT (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X)))
		      (NORMALIZED-IF-EXPRP X)
		      (FALSIFY1 X A))
		 (NOT (VALUE X (FALSIFY1 X A)))),

  which simplifies, applying VALUE-SHORT-CUT, and unfolding the
  functions FALSIFY1 and NORMALIZED-IF-EXPRP, to:

        T.

Case 9. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (FALSIFY1 X A)))
		      (NOT (FALSIFY1 (TEST X) A))
		      (NOT (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X)))
		      (NORMALIZED-IF-EXPRP X)
		      (FALSIFY1 X A))
		 (NOT (VALUE X (FALSIFY1 X A)))),

  which we simplify, rewriting with VALUE-SHORT-CUT, and unfolding
  FALSIFY1 and NORMALIZED-IF-EXPRP, to:

        T.

Case 8. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (VALUE (TEST X) (FALSIFY1 X A)))
		      (NOT (VALUE (TEST X)
				  (FALSIFY1 (TEST X) A)))
		      (NOT (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X)))
		      (NORMALIZED-IF-EXPRP X)
		      (FALSIFY1 X A))
		 (NOT (VALUE X (FALSIFY1 X A)))),

  which we simplify, rewriting with VALUE-SHORT-CUT, and expanding
  the functions FALSIFY1 and NORMALIZED-IF-EXPRP, to:

        T.

Case 7. (IMPLIES
	       (AND (IF-EXPRP X)
		    (NOT (VALUE (TEST X) (FALSIFY1 X A)))
		    (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		    (NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		    (NOT (VALUE (RIGHT-BRANCH X)
				(FALSIFY1 (RIGHT-BRANCH X)
					  (ASSUME-FALSE (TEST X) A))))
		    (NORMALIZED-IF-EXPRP X)
		    (FALSIFY1 X A))
	       (NOT (VALUE X (FALSIFY1 X A)))),

  which simplifies, applying VALUE-SHORT-CUT and
  ASSIGNMENT-IMPLIES-ASSIGNED, and unfolding FALSIFY1,
  NORMALIZED-IF-EXPRP, and VALUE, to two new formulas:

  Case 7.2.
          (IMPLIES
	   (AND (IF-EXPRP X)
		(NOT (ASSIGNEDP (TEST X) A))
		(FALSIFY1 (LEFT-BRANCH X)
			  (ASSUME-TRUE (TEST X) A))
		(NOT (ASSIGNMENT (TEST X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		(NOT (NORMALIZED-IF-EXPRP (TEST X)))
		(NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		(NOT (VALUE (RIGHT-BRANCH X)
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A))))
		(NOT (IF-EXPRP (TEST X)))
		(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X)))
	   (NOT (VALUE X
		       (FALSIFY1 (LEFT-BRANCH X)
				 (ASSUME-TRUE (TEST X) A))))).

    This simplifies further, applying CAR-CONS, CDR-CONS, and
    FALSIFY1-EXTENDS-MODELS, and unfolding the functions ASSUME-TRUE,
    ASSIGNEDP, ASSIGNMENT, and NORMALIZED-IF-EXPRP, to:

          T.

  Case 7.1.
          (IMPLIES
	       (AND (IF-EXPRP X)
		    (ASSIGNEDP (TEST X) A)
		    (ASSIGNMENT (TEST X) A)
		    (NOT (ASSIGNMENT (TEST X)
				     (FALSIFY1 (LEFT-BRANCH X) A)))
		    (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		    (NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		    (NOT (VALUE (RIGHT-BRANCH X)
				(FALSIFY1 (RIGHT-BRANCH X)
					  (ASSUME-FALSE (TEST X) A))))
		    (NOT (IF-EXPRP (TEST X)))
		    (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		    (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		    (FALSIFY1 (LEFT-BRANCH X) A))
	       (NOT (VALUE X
			   (FALSIFY1 (LEFT-BRANCH X) A)))),

    which again simplifies, rewriting with
    ASSIGNMENT-IMPLIES-ASSIGNED and FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 6. (IMPLIES
	       (AND (IF-EXPRP X)
		    (NOT (VALUE (TEST X) (FALSIFY1 X A)))
		    (NOT (FALSIFY1 (TEST X) A))
		    (NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		    (NOT (VALUE (RIGHT-BRANCH X)
				(FALSIFY1 (RIGHT-BRANCH X)
					  (ASSUME-FALSE (TEST X) A))))
		    (NORMALIZED-IF-EXPRP X)
		    (FALSIFY1 X A))
	       (NOT (VALUE X (FALSIFY1 X A)))),

  which simplifies, rewriting with VALUE-SHORT-CUT and
  ASSIGNMENT-IMPLIES-ASSIGNED, and unfolding the definitions of
  FALSIFY1, NORMALIZED-IF-EXPRP, and VALUE, to two new formulas:

  Case 6.2.
          (IMPLIES
	   (AND (IF-EXPRP X)
		(NOT (ASSIGNEDP (TEST X) A))
		(FALSIFY1 (LEFT-BRANCH X)
			  (ASSUME-TRUE (TEST X) A))
		(NOT (ASSIGNMENT (TEST X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		(NOT (FALSIFY1 (TEST X) A))
		(NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		(NOT (VALUE (RIGHT-BRANCH X)
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A))))
		(NOT (IF-EXPRP (TEST X)))
		(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X)))
	   (NOT (VALUE X
		       (FALSIFY1 (LEFT-BRANCH X)
				 (ASSUME-TRUE (TEST X) A))))).

    This simplifies further, applying CAR-CONS, CDR-CONS, and
    FALSIFY1-EXTENDS-MODELS, and opening up the functions ASSUME-TRUE,
    ASSIGNEDP, ASSIGNMENT, EQUAL, IF-EXPRP, FALSIFY1, and
    ASSUME-FALSE, to the goal:

          (IMPLIES
	   (AND
	    (IF-EXPRP X)
	    (NOT (ASSIGNEDP (TEST X) A))
	    (FALSIFY1 (LEFT-BRANCH X)
		      (CONS (CONS (TEST X) T) A))
	    (NOT (EQUAL (TEST X) T))
	    (NOT (TEST X))
	    (NOT A)
	    (NOT (FALSIFY1 (RIGHT-BRANCH X) F))
	    (NOT (VALUE (RIGHT-BRANCH X)
			(FALSIFY1 (RIGHT-BRANCH X)
				  '((1FALSE . 1FALSE) . 1FALSE))))
	    (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
	    (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X)))
	   (NOT (VALUE X
		       (FALSIFY1 (LEFT-BRANCH X)
				 '((1FALSE . 1TRUE) . 1FALSE))))),

    which we again simplify, expanding the definition of ASSIGNEDP,
    to:

          T.

  Case 6.1.
          (IMPLIES
	       (AND (IF-EXPRP X)
		    (ASSIGNEDP (TEST X) A)
		    (ASSIGNMENT (TEST X) A)
		    (NOT (ASSIGNMENT (TEST X)
				     (FALSIFY1 (LEFT-BRANCH X) A)))
		    (NOT (FALSIFY1 (TEST X) A))
		    (NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		    (NOT (VALUE (RIGHT-BRANCH X)
				(FALSIFY1 (RIGHT-BRANCH X)
					  (ASSUME-FALSE (TEST X) A))))
		    (NOT (IF-EXPRP (TEST X)))
		    (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		    (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		    (FALSIFY1 (LEFT-BRANCH X) A))
	       (NOT (VALUE X
			   (FALSIFY1 (LEFT-BRANCH X) A)))),

    which we again simplify, applying the lemmas
    ASSIGNMENT-IMPLIES-ASSIGNED and FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 5. (IMPLIES
	       (AND (IF-EXPRP X)
		    (NOT (VALUE (TEST X) (FALSIFY1 X A)))
		    (NOT (VALUE (TEST X)
				(FALSIFY1 (TEST X) A)))
		    (NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		    (NOT (VALUE (RIGHT-BRANCH X)
				(FALSIFY1 (RIGHT-BRANCH X)
					  (ASSUME-FALSE (TEST X) A))))
		    (NORMALIZED-IF-EXPRP X)
		    (FALSIFY1 X A))
	       (NOT (VALUE X (FALSIFY1 X A)))),

  which we simplify, rewriting with VALUE-SHORT-CUT and
  ASSIGNMENT-IMPLIES-ASSIGNED, and unfolding the functions FALSIFY1,
  NORMALIZED-IF-EXPRP, and VALUE, to two new formulas:

  Case 5.2.
          (IMPLIES
	   (AND (IF-EXPRP X)
		(NOT (ASSIGNEDP (TEST X) A))
		(FALSIFY1 (LEFT-BRANCH X)
			  (ASSUME-TRUE (TEST X) A))
		(NOT (ASSIGNMENT (TEST X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		(NOT (VALUE (TEST X)
			    (FALSIFY1 (TEST X) A)))
		(NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		(NOT (VALUE (RIGHT-BRANCH X)
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A))))
		(NOT (IF-EXPRP (TEST X)))
		(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X)))
	   (NOT (VALUE X
		       (FALSIFY1 (LEFT-BRANCH X)
				 (ASSUME-TRUE (TEST X) A))))).

    However this simplifies further, rewriting with CAR-CONS,
    CDR-CONS, and FALSIFY1-EXTENDS-MODELS, and unfolding the
    definitions of ASSUME-TRUE, ASSIGNEDP, ASSIGNMENT, EQUAL,
    IF-EXPRP, FALSIFY1, VALUE, CONS, and ASSUME-FALSE, to:

          (IMPLIES
	   (AND (IF-EXPRP X)
		(NOT (ASSIGNEDP (TEST X) A))
		(FALSIFY1 (LEFT-BRANCH X)
			  (CONS (CONS (TEST X) T) A))
		(NOT (EQUAL (TEST X) T))
		(NOT (TEST X))
		(NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		(NOT (VALUE (RIGHT-BRANCH X)
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (CONS '(1FALSE . 1FALSE) A))))
		(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X)))
	   (NOT (VALUE X
		       (FALSIFY1 (LEFT-BRANCH X)
				 (CONS '(1FALSE . 1TRUE) A))))),

    which again simplifies, expanding EQUAL and ASSIGNEDP, to:

          T.

  Case 5.1.
          (IMPLIES
	       (AND (IF-EXPRP X)
		    (ASSIGNEDP (TEST X) A)
		    (ASSIGNMENT (TEST X) A)
		    (NOT (ASSIGNMENT (TEST X)
				     (FALSIFY1 (LEFT-BRANCH X) A)))
		    (NOT (VALUE (TEST X)
				(FALSIFY1 (TEST X) A)))
		    (NOT (FALSIFY1 (RIGHT-BRANCH X) A))
		    (NOT (VALUE (RIGHT-BRANCH X)
				(FALSIFY1 (RIGHT-BRANCH X)
					  (ASSUME-FALSE (TEST X) A))))
		    (NOT (IF-EXPRP (TEST X)))
		    (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		    (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		    (FALSIFY1 (LEFT-BRANCH X) A))
	       (NOT (VALUE X
			   (FALSIFY1 (LEFT-BRANCH X) A)))).

    However this simplifies again, applying
    ASSIGNMENT-IMPLIES-ASSIGNED and FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 4. (IMPLIES
	       (AND (IF-EXPRP X)
		    (NOT (VALUE (TEST X) (FALSIFY1 X A)))
		    (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		    (NOT (VALUE (RIGHT-BRANCH X)
				(FALSIFY1 (RIGHT-BRANCH X) A)))
		    (NOT (VALUE (RIGHT-BRANCH X)
				(FALSIFY1 (RIGHT-BRANCH X)
					  (ASSUME-FALSE (TEST X) A))))
		    (NORMALIZED-IF-EXPRP X)
		    (FALSIFY1 X A))
	       (NOT (VALUE X (FALSIFY1 X A)))).

  This simplifies, rewriting with the lemmas VALUE-SHORT-CUT,
  ASSIGNMENT-IMPLIES-ASSIGNED, and FALSIFY1-EXTENDS-MODELS, and
  opening up the definitions of FALSIFY1, NORMALIZED-IF-EXPRP, and
  VALUE, to two new goals:

  Case 4.2.
          (IMPLIES
	   (AND (IF-EXPRP X)
		(NOT (ASSIGNEDP (TEST X) A))
		(FALSIFY1 (LEFT-BRANCH X)
			  (ASSUME-TRUE (TEST X) A))
		(NOT (ASSIGNMENT (TEST X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		(NOT (NORMALIZED-IF-EXPRP (TEST X)))
		(NOT (VALUE (RIGHT-BRANCH X)
			    (FALSIFY1 (RIGHT-BRANCH X) A)))
		(NOT (VALUE (RIGHT-BRANCH X)
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A))))
		(NOT (IF-EXPRP (TEST X)))
		(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X)))
	   (NOT (VALUE X
		       (FALSIFY1 (LEFT-BRANCH X)
				 (ASSUME-TRUE (TEST X) A))))).

    But this further simplifies, applying CAR-CONS, CDR-CONS, and
    FALSIFY1-EXTENDS-MODELS, and unfolding the functions ASSUME-TRUE,
    ASSIGNEDP, ASSIGNMENT, and NORMALIZED-IF-EXPRP, to:

          T.

  Case 4.1.
          (IMPLIES
	       (AND (IF-EXPRP X)
		    (ASSIGNEDP (TEST X) A)
		    (ASSIGNMENT (TEST X) A)
		    (NOT (ASSIGNMENT (TEST X)
				     (FALSIFY1 (LEFT-BRANCH X) A)))
		    (NOT (NORMALIZED-IF-EXPRP (TEST X)))
		    (NOT (VALUE (RIGHT-BRANCH X)
				(FALSIFY1 (RIGHT-BRANCH X) A)))
		    (NOT (VALUE (RIGHT-BRANCH X)
				(FALSIFY1 (RIGHT-BRANCH X)
					  (ASSUME-FALSE (TEST X) A))))
		    (NOT (IF-EXPRP (TEST X)))
		    (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		    (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		    (FALSIFY1 (LEFT-BRANCH X) A))
	       (NOT (VALUE X
			   (FALSIFY1 (LEFT-BRANCH X) A)))),

    which we again simplify, rewriting with
    ASSIGNMENT-IMPLIES-ASSIGNED and FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 3. (IMPLIES
	       (AND (IF-EXPRP X)
		    (NOT (VALUE (TEST X) (FALSIFY1 X A)))
		    (NOT (FALSIFY1 (TEST X) A))
		    (NOT (VALUE (RIGHT-BRANCH X)
				(FALSIFY1 (RIGHT-BRANCH X) A)))
		    (NOT (VALUE (RIGHT-BRANCH X)
				(FALSIFY1 (RIGHT-BRANCH X)
					  (ASSUME-FALSE (TEST X) A))))
		    (NORMALIZED-IF-EXPRP X)
		    (FALSIFY1 X A))
	       (NOT (VALUE X (FALSIFY1 X A)))),

  which we simplify, applying VALUE-SHORT-CUT,
  ASSIGNMENT-IMPLIES-ASSIGNED, and FALSIFY1-EXTENDS-MODELS, and
  unfolding the functions FALSIFY1, NORMALIZED-IF-EXPRP, and VALUE,
  to the following two new formulas:

  Case 3.2.
          (IMPLIES
	   (AND (IF-EXPRP X)
		(NOT (ASSIGNEDP (TEST X) A))
		(FALSIFY1 (LEFT-BRANCH X)
			  (ASSUME-TRUE (TEST X) A))
		(NOT (ASSIGNMENT (TEST X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		(NOT (FALSIFY1 (TEST X) A))
		(NOT (VALUE (RIGHT-BRANCH X)
			    (FALSIFY1 (RIGHT-BRANCH X) A)))
		(NOT (VALUE (RIGHT-BRANCH X)
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A))))
		(NOT (IF-EXPRP (TEST X)))
		(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X)))
	   (NOT (VALUE X
		       (FALSIFY1 (LEFT-BRANCH X)
				 (ASSUME-TRUE (TEST X) A))))),

    which further simplifies, applying CAR-CONS, CDR-CONS, and
    FALSIFY1-EXTENDS-MODELS, and unfolding the functions ASSUME-TRUE,
    ASSIGNEDP, ASSIGNMENT, EQUAL, IF-EXPRP, FALSIFY1, and
    ASSUME-FALSE, to the formula:

          (IMPLIES
	   (AND
	    (IF-EXPRP X)
	    (NOT (ASSIGNEDP (TEST X) A))
	    (FALSIFY1 (LEFT-BRANCH X)
		      (CONS (CONS (TEST X) T) A))
	    (NOT (EQUAL (TEST X) T))
	    (NOT (TEST X))
	    (NOT A)
	    (NOT (VALUE (RIGHT-BRANCH X)
			(FALSIFY1 (RIGHT-BRANCH X) F)))
	    (NOT (VALUE (RIGHT-BRANCH X)
			(FALSIFY1 (RIGHT-BRANCH X)
				  '((1FALSE . 1FALSE) . 1FALSE))))
	    (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
	    (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X)))
	   (NOT (VALUE X
		       (FALSIFY1 (LEFT-BRANCH X)
				 '((1FALSE . 1TRUE) . 1FALSE))))),

    which we again simplify, unfolding the function ASSIGNEDP, to:

          T.

  Case 3.1.
          (IMPLIES
	       (AND (IF-EXPRP X)
		    (ASSIGNEDP (TEST X) A)
		    (ASSIGNMENT (TEST X) A)
		    (NOT (ASSIGNMENT (TEST X)
				     (FALSIFY1 (LEFT-BRANCH X) A)))
		    (NOT (FALSIFY1 (TEST X) A))
		    (NOT (VALUE (RIGHT-BRANCH X)
				(FALSIFY1 (RIGHT-BRANCH X) A)))
		    (NOT (VALUE (RIGHT-BRANCH X)
				(FALSIFY1 (RIGHT-BRANCH X)
					  (ASSUME-FALSE (TEST X) A))))
		    (NOT (IF-EXPRP (TEST X)))
		    (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		    (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		    (FALSIFY1 (LEFT-BRANCH X) A))
	       (NOT (VALUE X
			   (FALSIFY1 (LEFT-BRANCH X) A)))).

    But this simplifies again, applying ASSIGNMENT-IMPLIES-ASSIGNED
    and FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 2. (IMPLIES
	       (AND (IF-EXPRP X)
		    (NOT (VALUE (TEST X) (FALSIFY1 X A)))
		    (NOT (VALUE (TEST X)
				(FALSIFY1 (TEST X) A)))
		    (NOT (VALUE (RIGHT-BRANCH X)
				(FALSIFY1 (RIGHT-BRANCH X) A)))
		    (NOT (VALUE (RIGHT-BRANCH X)
				(FALSIFY1 (RIGHT-BRANCH X)
					  (ASSUME-FALSE (TEST X) A))))
		    (NORMALIZED-IF-EXPRP X)
		    (FALSIFY1 X A))
	       (NOT (VALUE X (FALSIFY1 X A)))).

  This simplifies, rewriting with VALUE-SHORT-CUT,
  ASSIGNMENT-IMPLIES-ASSIGNED, and FALSIFY1-EXTENDS-MODELS, and
  unfolding the functions FALSIFY1, NORMALIZED-IF-EXPRP, and VALUE,
  to the following two new goals:

  Case 2.2.
          (IMPLIES
	   (AND (IF-EXPRP X)
		(NOT (ASSIGNEDP (TEST X) A))
		(FALSIFY1 (LEFT-BRANCH X)
			  (ASSUME-TRUE (TEST X) A))
		(NOT (ASSIGNMENT (TEST X)
				 (FALSIFY1 (LEFT-BRANCH X)
					   (ASSUME-TRUE (TEST X) A))))
		(NOT (VALUE (TEST X)
			    (FALSIFY1 (TEST X) A)))
		(NOT (VALUE (RIGHT-BRANCH X)
			    (FALSIFY1 (RIGHT-BRANCH X) A)))
		(NOT (VALUE (RIGHT-BRANCH X)
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (ASSUME-FALSE (TEST X) A))))
		(NOT (IF-EXPRP (TEST X)))
		(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X)))
	   (NOT (VALUE X
		       (FALSIFY1 (LEFT-BRANCH X)
				 (ASSUME-TRUE (TEST X) A))))).

    But this further simplifies, rewriting with CAR-CONS, CDR-CONS,
    and FALSIFY1-EXTENDS-MODELS, and expanding the definitions of
    ASSUME-TRUE, ASSIGNEDP, ASSIGNMENT, EQUAL, IF-EXPRP, FALSIFY1,
    VALUE, CONS, and ASSUME-FALSE, to:

          (IMPLIES
	   (AND (IF-EXPRP X)
		(NOT (ASSIGNEDP (TEST X) A))
		(FALSIFY1 (LEFT-BRANCH X)
			  (CONS (CONS (TEST X) T) A))
		(NOT (EQUAL (TEST X) T))
		(NOT (TEST X))
		(NOT (VALUE (RIGHT-BRANCH X)
			    (FALSIFY1 (RIGHT-BRANCH X) A)))
		(NOT (VALUE (RIGHT-BRANCH X)
			    (FALSIFY1 (RIGHT-BRANCH X)
				      (CONS '(1FALSE . 1FALSE) A))))
		(NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		(NORMALIZED-IF-EXPRP (RIGHT-BRANCH X)))
	   (NOT (VALUE X
		       (FALSIFY1 (LEFT-BRANCH X)
				 (CONS '(1FALSE . 1TRUE) A))))),

    which we again simplify, unfolding the functions EQUAL and
    ASSIGNEDP, to:

          T.

  Case 2.1.
          (IMPLIES
	       (AND (IF-EXPRP X)
		    (ASSIGNEDP (TEST X) A)
		    (ASSIGNMENT (TEST X) A)
		    (NOT (ASSIGNMENT (TEST X)
				     (FALSIFY1 (LEFT-BRANCH X) A)))
		    (NOT (VALUE (TEST X)
				(FALSIFY1 (TEST X) A)))
		    (NOT (VALUE (RIGHT-BRANCH X)
				(FALSIFY1 (RIGHT-BRANCH X) A)))
		    (NOT (VALUE (RIGHT-BRANCH X)
				(FALSIFY1 (RIGHT-BRANCH X)
					  (ASSUME-FALSE (TEST X) A))))
		    (NOT (IF-EXPRP (TEST X)))
		    (NORMALIZED-IF-EXPRP (LEFT-BRANCH X))
		    (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X))
		    (FALSIFY1 (LEFT-BRANCH X) A))
	       (NOT (VALUE X
			   (FALSIFY1 (LEFT-BRANCH X) A)))).

    However this again simplifies, applying the lemmas
    ASSIGNMENT-IMPLIES-ASSIGNED and FALSIFY1-EXTENDS-MODELS, to:

          T.

Case 1. (IMPLIES (AND (NOT (IF-EXPRP X))
		      (NORMALIZED-IF-EXPRP X)
		      (FALSIFY1 X A))
		 (NOT (VALUE X (FALSIFY1 X A)))),

  which simplifies, rewriting with CAR-CONS and CDR-CONS, and
  expanding the functions NORMALIZED-IF-EXPRP, FALSIFY1, VALUE, and
  ASSIGNMENT, to two new goals:

  Case 1.2.
          (IMPLIES (AND (NOT (IF-EXPRP X))
			(NOT (ASSIGNMENT X A))
			A
			(NOT (ASSIGNEDP X A)))
		   (NOT (ASSIGNMENT X (CONS (CONS X F) A)))),

    which we again simplify, applying CDR-CONS and CAR-CONS, and
    expanding the function ASSIGNMENT, to:

          (IMPLIES (AND (NOT (IF-EXPRP X))
			(NOT (ASSIGNMENT X A))
			A
			(NOT (ASSIGNEDP X A)))
		   (NOT (EQUAL X T))).

    But this again simplifies, expanding the definitions of IF-EXPRP,
    EQUAL, and ASSIGNMENT, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NOT (IF-EXPRP X))
			(NOT (ASSIGNEDP X A)))
		   (NOT (EQUAL X T))),

    which we again simplify, applying the lemma
    ASSIGNMENT-IMPLIES-ASSIGNED, and unfolding the definitions of
    IF-EXPRP, ASSIGNMENT, and EQUAL, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 220.115992 5.72201335 ]

FALSIFY1-FALSIFIES 


(PROVE-LEMMA TAUTOLOGYP-FAILS-MEANS-FALSIFY1-WINS
	     (REWRITE)
	     (IMPLIES (AND (NORMALIZED-IF-EXPRP X)
			   (NOT (TAUTOLOGYP X A))
			   A)
		      (FALSIFY1 X A)))

     Call the conjecture *1.


     We will appeal to induction.  Three inductions are suggested by
terms in the conjecture.  However, they merge into one likely
candidate induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (AND (IF-EXPRP X)
			 (ASSIGNEDP (TEST X) A)
			 (ASSIGNMENT (TEST X) A)
			 (P (LEFT-BRANCH X) A))
		    (P X A))
	   (IMPLIES (AND (IF-EXPRP X)
			 (ASSIGNEDP (TEST X) A)
			 (NOT (ASSIGNMENT (TEST X) A))
			 (P (RIGHT-BRANCH X) A))
		    (P X A))
	   (IMPLIES (AND (IF-EXPRP X)
			 (NOT (ASSIGNEDP (TEST X) A))
			 (FALSIFY1 (LEFT-BRANCH X)
				   (ASSUME-TRUE (TEST X) A))
			 (P (LEFT-BRANCH X)
			    (ASSUME-TRUE (TEST X) A)))
		    (P X A))
	   (IMPLIES (AND (IF-EXPRP X)
			 (NOT (ASSIGNEDP (TEST X) A))
			 (NOT (FALSIFY1 (LEFT-BRANCH X)
					(ASSUME-TRUE (TEST X) A)))
			 (P (LEFT-BRANCH X)
			    (ASSUME-TRUE (TEST X) A))
			 (P (RIGHT-BRANCH X)
			    (ASSUME-FALSE (TEST X) A)))
		    (P X A))
	   (IMPLIES (AND (NOT (IF-EXPRP X))
			 (ASSIGNEDP X A)
			 (ASSIGNMENT X A))
		    (P X A))
	   (IMPLIES (AND (NOT (IF-EXPRP X))
			 (ASSIGNEDP X A)
			 (NOT (ASSIGNMENT X A)))
		    (P X A))
	   (IMPLIES (AND (NOT (IF-EXPRP X))
			 (NOT (ASSIGNEDP X A)))
		    (P X A))).
Linear arithmetic and the lemmas LEFT-BRANCH-LESSP and
RIGHT-BRANCH-LESSP establish that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  Note, however, the inductive instances chosen for A.
The above induction scheme generates 16 new goals:

Case 16.(IMPLIES (AND (IF-EXPRP X)
		      (ASSIGNEDP (TEST X) A)
		      (ASSIGNMENT (TEST X) A)
		      (NOT (NORMALIZED-IF-EXPRP (LEFT-BRANCH X)))
		      (NORMALIZED-IF-EXPRP X)
		      (NOT (TAUTOLOGYP X A))
		      A)
		 (FALSIFY1 X A)),

  which we simplify, rewriting with ASSIGNMENT-IMPLIES-ASSIGNED, and
  unfolding the definition of NORMALIZED-IF-EXPRP, to:

        T.

Case 15.(IMPLIES (AND (IF-EXPRP X)
		      (ASSIGNEDP (TEST X) A)
		      (ASSIGNMENT (TEST X) A)
		      (TAUTOLOGYP (LEFT-BRANCH X) A)
		      (NORMALIZED-IF-EXPRP X)
		      (NOT (TAUTOLOGYP X A))
		      A)
		 (FALSIFY1 X A)).

  This simplifies, applying ASSIGNMENT-IMPLIES-ASSIGNED, and
  expanding the functions NORMALIZED-IF-EXPRP and TAUTOLOGYP, to:

        T.

Case 14.(IMPLIES (AND (IF-EXPRP X)
		      (ASSIGNEDP (TEST X) A)
		      (ASSIGNMENT (TEST X) A)
		      (FALSIFY1 (LEFT-BRANCH X) A)
		      (NORMALIZED-IF-EXPRP X)
		      (NOT (TAUTOLOGYP X A))
		      A)
		 (FALSIFY1 X A)).

  This simplifies, rewriting with the lemma
  ASSIGNMENT-IMPLIES-ASSIGNED, and unfolding the functions
  NORMALIZED-IF-EXPRP, TAUTOLOGYP, and FALSIFY1, to:

        T.

Case 13.(IMPLIES (AND (IF-EXPRP X)
		      (ASSIGNEDP (TEST X) A)
		      (NOT (ASSIGNMENT (TEST X) A))
		      (NOT (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X)))
		      (NORMALIZED-IF-EXPRP X)
		      (NOT (TAUTOLOGYP X A))
		      A)
		 (FALSIFY1 X A)).

  This simplifies, unfolding the definition of NORMALIZED-IF-EXPRP,
  to:

        T.

Case 12.(IMPLIES (AND (IF-EXPRP X)
		      (ASSIGNEDP (TEST X) A)
		      (NOT (ASSIGNMENT (TEST X) A))
		      (TAUTOLOGYP (RIGHT-BRANCH X) A)
		      (NORMALIZED-IF-EXPRP X)
		      (NOT (TAUTOLOGYP X A))
		      A)
		 (FALSIFY1 X A)),

  which we simplify, unfolding the functions NORMALIZED-IF-EXPRP and
  TAUTOLOGYP, to:

        T.

Case 11.(IMPLIES (AND (IF-EXPRP X)
		      (ASSIGNEDP (TEST X) A)
		      (NOT (ASSIGNMENT (TEST X) A))
		      (FALSIFY1 (RIGHT-BRANCH X) A)
		      (NORMALIZED-IF-EXPRP X)
		      (NOT (TAUTOLOGYP X A))
		      A)
		 (FALSIFY1 X A)),

  which we simplify, expanding the definitions of NORMALIZED-IF-EXPRP,
  TAUTOLOGYP, and FALSIFY1, to:

        T.

Case 10.(IMPLIES (AND (IF-EXPRP X)
		      (NOT (ASSIGNEDP (TEST X) A))
		      (NOT (FALSIFY1 (LEFT-BRANCH X)
				     (ASSUME-TRUE (TEST X) A)))
		      (NOT (NORMALIZED-IF-EXPRP (LEFT-BRANCH X)))
		      (NOT (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X)))
		      (NORMALIZED-IF-EXPRP X)
		      (NOT (TAUTOLOGYP X A))
		      A)
		 (FALSIFY1 X A)),

  which we simplify, unfolding NORMALIZED-IF-EXPRP, to:

        T.

Case 9. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (ASSIGNEDP (TEST X) A))
		      (NOT (FALSIFY1 (LEFT-BRANCH X)
				     (ASSUME-TRUE (TEST X) A)))
		      (TAUTOLOGYP (LEFT-BRANCH X)
				  (ASSUME-TRUE (TEST X) A))
		      (NOT (NORMALIZED-IF-EXPRP (RIGHT-BRANCH X)))
		      (NORMALIZED-IF-EXPRP X)
		      (NOT (TAUTOLOGYP X A))
		      A)
		 (FALSIFY1 X A)).

  This simplifies, expanding NORMALIZED-IF-EXPRP, to:

        T.

Case 8. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (ASSIGNEDP (TEST X) A))
		      (NOT (FALSIFY1 (LEFT-BRANCH X)
				     (ASSUME-TRUE (TEST X) A)))
		      (NOT (NORMALIZED-IF-EXPRP (LEFT-BRANCH X)))
		      (TAUTOLOGYP (RIGHT-BRANCH X)
				  (ASSUME-FALSE (TEST X) A))
		      (NORMALIZED-IF-EXPRP X)
		      (NOT (TAUTOLOGYP X A))
		      A)
		 (FALSIFY1 X A)),

  which simplifies, opening up NORMALIZED-IF-EXPRP, to:

        T.

Case 7. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (ASSIGNEDP (TEST X) A))
		      (NOT (FALSIFY1 (LEFT-BRANCH X)
				     (ASSUME-TRUE (TEST X) A)))
		      (TAUTOLOGYP (LEFT-BRANCH X)
				  (ASSUME-TRUE (TEST X) A))
		      (TAUTOLOGYP (RIGHT-BRANCH X)
				  (ASSUME-FALSE (TEST X) A))
		      (NORMALIZED-IF-EXPRP X)
		      (NOT (TAUTOLOGYP X A))
		      A)
		 (FALSIFY1 X A)).

  This simplifies, unfolding NORMALIZED-IF-EXPRP and TAUTOLOGYP, to:

        T.

Case 6. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (ASSIGNEDP (TEST X) A))
		      (NOT (FALSIFY1 (LEFT-BRANCH X)
				     (ASSUME-TRUE (TEST X) A)))
		      (NOT (NORMALIZED-IF-EXPRP (LEFT-BRANCH X)))
		      (FALSIFY1 (RIGHT-BRANCH X)
				(ASSUME-FALSE (TEST X) A))
		      (NORMALIZED-IF-EXPRP X)
		      (NOT (TAUTOLOGYP X A))
		      A)
		 (FALSIFY1 X A)),

  which we simplify, expanding NORMALIZED-IF-EXPRP, to:

        T.

Case 5. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (ASSIGNEDP (TEST X) A))
		      (NOT (FALSIFY1 (LEFT-BRANCH X)
				     (ASSUME-TRUE (TEST X) A)))
		      (TAUTOLOGYP (LEFT-BRANCH X)
				  (ASSUME-TRUE (TEST X) A))
		      (FALSIFY1 (RIGHT-BRANCH X)
				(ASSUME-FALSE (TEST X) A))
		      (NORMALIZED-IF-EXPRP X)
		      (NOT (TAUTOLOGYP X A))
		      A)
		 (FALSIFY1 X A)),

  which we simplify, unfolding the definitions of NORMALIZED-IF-EXPRP,
  TAUTOLOGYP, and FALSIFY1, to:

        T.

Case 4. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (ASSIGNEDP (TEST X) A))
		      (FALSIFY1 (LEFT-BRANCH X)
				(ASSUME-TRUE (TEST X) A))
		      (NORMALIZED-IF-EXPRP X)
		      (NOT (TAUTOLOGYP X A))
		      A)
		 (FALSIFY1 X A)),

  which simplifies, unfolding the definitions of NORMALIZED-IF-EXPRP,
  TAUTOLOGYP, and FALSIFY1, to:

        T.

Case 3. (IMPLIES (AND (NOT (IF-EXPRP X))
		      (ASSIGNEDP X A)
		      (ASSIGNMENT X A)
		      (NORMALIZED-IF-EXPRP X)
		      (NOT (TAUTOLOGYP X A))
		      A)
		 (FALSIFY1 X A)),

  which simplifies, applying ASSIGNMENT-IMPLIES-ASSIGNED, and opening
  up the functions NORMALIZED-IF-EXPRP and TAUTOLOGYP, to:

        T.

Case 2. (IMPLIES (AND (NOT (IF-EXPRP X))
		      (ASSIGNEDP X A)
		      (NOT (ASSIGNMENT X A))
		      (NORMALIZED-IF-EXPRP X)
		      (NOT (TAUTOLOGYP X A))
		      A)
		 (FALSIFY1 X A)).

  This simplifies, opening up the functions NORMALIZED-IF-EXPRP,
  TAUTOLOGYP, and FALSIFY1, to:

        T.

Case 1. (IMPLIES (AND (NOT (IF-EXPRP X))
		      (NOT (ASSIGNEDP X A))
		      (NORMALIZED-IF-EXPRP X)
		      (NOT (TAUTOLOGYP X A))
		      A)
		 (FALSIFY1 X A)).

  This simplifies, expanding the definitions of NORMALIZED-IF-EXPRP,
  TAUTOLOGYP, and FALSIFY1, to the new goal:

        (IMPLIES (AND (NOT (IF-EXPRP X))
		      (NOT (ASSIGNEDP X A))
		      (NOT (ASSIGNMENT X A))
		      A)
		 (CONS (CONS X F) A)),

  which we again simplify, trivially, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 8.7739583 0.83604329 ]

TAUTOLOGYP-FAILS-MEANS-FALSIFY1-WINS 


(PROVE-LEMMA NORMALIZE-IS-SOUND
	     (REWRITE)
	     (EQUAL (VALUE (NORMALIZE X) A)
		    (VALUE X A)))

     Call the conjecture *1.


     Perhaps we can prove it by induction.  There are two plausible
inductions, both of which are unflawed.  So we will choose the one
suggested by the largest number of nonprimitive recursive functions.
We will induct according to the following scheme:
      (AND (IMPLIES (AND (IF-EXPRP X)
			 (IF-EXPRP (TEST X))
			 (P (CONS-IF (TEST (TEST X))
				     (CONS-IF (LEFT-BRANCH (TEST X))
					      (LEFT-BRANCH X)
					      (RIGHT-BRANCH X))
				     (CONS-IF (RIGHT-BRANCH (TEST X))
					      (LEFT-BRANCH X)
					      (RIGHT-BRANCH X)))
			    A))
		    (P X A))
	   (IMPLIES (AND (IF-EXPRP X)
			 (NOT (IF-EXPRP (TEST X)))
			 (P (RIGHT-BRANCH X) A)
			 (P (LEFT-BRANCH X) A))
		    (P X A))
	   (IMPLIES (NOT (IF-EXPRP X)) (P X A))).
Linear arithmetic, the lemmas CAR-CONS, IF-COMPLEXITY-NOT-0,
EQUAL-TIMES-0, LESSP-TIMES-CANCELLATION, LESSP-PLUS-CANCELATION,
CDR-CONS, SUB1-ADD1, ASSOCIATIVITY-OF-PLUS, COMMUTATIVITY2-OF-PLUS,
COMMUTATIVITY2-OF-TIMES, COMMUTATIVITY-OF-TIMES, TEST-CONS-IF,
LEFT-BRANCH-CONS-IF, RIGHT-BRANCH-CONS-IF,
DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, IF-COMPLEXITY-GOES-DOWN2, and
IF-COMPLEXITY-GOES-DOWN1, and the definitions of LEX2, LESSP,
IF-DEPTH, IF-COMPLEXITY, CAR, CONS, and ADD1 establish that the
measure (LIST (IF-COMPLEXITY X) (IF-DEPTH X)) decreases according to
the well-founded relation LEX2 in each induction step of the scheme.
The above induction scheme produces three new formulas:

Case 3. (IMPLIES
	 (AND
	  (IF-EXPRP X)
	  (IF-EXPRP (TEST X))
	  (EQUAL
	   (VALUE (NORMALIZE (CONS-IF (TEST (TEST X))
				      (CONS-IF (LEFT-BRANCH (TEST X))
					       (LEFT-BRANCH X)
					       (RIGHT-BRANCH X))
				      (CONS-IF (RIGHT-BRANCH (TEST X))
					       (LEFT-BRANCH X)
					       (RIGHT-BRANCH X))))
		  A)
	   (VALUE (CONS-IF (TEST (TEST X))
			   (CONS-IF (LEFT-BRANCH (TEST X))
				    (LEFT-BRANCH X)
				    (RIGHT-BRANCH X))
			   (CONS-IF (RIGHT-BRANCH (TEST X))
				    (LEFT-BRANCH X)
				    (RIGHT-BRANCH X)))
		  A)))
	 (EQUAL (VALUE (NORMALIZE X) A)
		(VALUE X A))).

  This simplifies, applying RIGHT-BRANCH-CONS-IF, LEFT-BRANCH-CONS-IF,
  and TEST-CONS-IF, and expanding VALUE and NORMALIZE, to:

        T.

Case 2. (IMPLIES (AND (IF-EXPRP X)
		      (NOT (IF-EXPRP (TEST X)))
		      (EQUAL (VALUE (NORMALIZE (RIGHT-BRANCH X)) A)
			     (VALUE (RIGHT-BRANCH X) A))
		      (EQUAL (VALUE (NORMALIZE (LEFT-BRANCH X)) A)
			     (VALUE (LEFT-BRANCH X) A)))
		 (EQUAL (VALUE (NORMALIZE X) A)
			(VALUE X A))).

  This simplifies, applying RIGHT-BRANCH-CONS-IF, LEFT-BRANCH-CONS-IF,
  and TEST-CONS-IF, and unfolding NORMALIZE and VALUE, to:

        T.

Case 1. (IMPLIES (NOT (IF-EXPRP X))
		 (EQUAL (VALUE (NORMALIZE X) A)
			(VALUE X A))),

  which simplifies, expanding the definitions of NORMALIZE and VALUE,
  to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 3.99498698 0.31501465 ]

NORMALIZE-IS-SOUND 


(PROVE-LEMMA NORMALIZE-NORMALIZES
	     (REWRITE)
	     (NORMALIZED-IF-EXPRP (NORMALIZE X)))

     Give the conjecture the name *1.


     Let us appeal to the induction principle.  There is only one
suggested induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (AND (IF-EXPRP X)
			 (IF-EXPRP (TEST X))
			 (P (CONS-IF (TEST (TEST X))
				     (CONS-IF (LEFT-BRANCH (TEST X))
					      (LEFT-BRANCH X)
					      (RIGHT-BRANCH X))
				     (CONS-IF (RIGHT-BRANCH (TEST X))
					      (LEFT-BRANCH X)
					      (RIGHT-BRANCH X)))))
		    (P X))
	   (IMPLIES (AND (IF-EXPRP X)
			 (NOT (IF-EXPRP (TEST X)))
			 (P (RIGHT-BRANCH X))
			 (P (LEFT-BRANCH X)))
		    (P X))
	   (IMPLIES (NOT (IF-EXPRP X)) (P X))).
Linear arithmetic, the lemmas CAR-CONS, IF-COMPLEXITY-NOT-0,
EQUAL-TIMES-0, LESSP-TIMES-CANCELLATION, LESSP-PLUS-CANCELATION,
CDR-CONS, SUB1-ADD1, ASSOCIATIVITY-OF-PLUS, COMMUTATIVITY2-OF-PLUS,
COMMUTATIVITY2-OF-TIMES, COMMUTATIVITY-OF-TIMES, TEST-CONS-IF,
LEFT-BRANCH-CONS-IF, RIGHT-BRANCH-CONS-IF,
DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, IF-COMPLEXITY-GOES-DOWN2, and
IF-COMPLEXITY-GOES-DOWN1, and the definitions of LEX2, LESSP,
IF-DEPTH, IF-COMPLEXITY, CAR, CONS, and ADD1 inform us that the
measure (LIST (IF-COMPLEXITY X) (IF-DEPTH X)) decreases according to
the well-founded relation LEX2 in each induction step of the scheme.
The above induction scheme generates three new conjectures:

Case 3. (IMPLIES
	 (AND
	  (IF-EXPRP X)
	  (IF-EXPRP (TEST X))
	  (NORMALIZED-IF-EXPRP
		  (NORMALIZE (CONS-IF (TEST (TEST X))
				      (CONS-IF (LEFT-BRANCH (TEST X))
					       (LEFT-BRANCH X)
					       (RIGHT-BRANCH X))
				      (CONS-IF (RIGHT-BRANCH (TEST X))
					       (LEFT-BRANCH X)
					       (RIGHT-BRANCH X))))))
	 (NORMALIZED-IF-EXPRP (NORMALIZE X))),

  which simplifies, opening up the definition of NORMALIZE, to:

        T.

Case 2. (IMPLIES
	       (AND (IF-EXPRP X)
		    (NOT (IF-EXPRP (TEST X)))
		    (NORMALIZED-IF-EXPRP (NORMALIZE (RIGHT-BRANCH X)))
		    (NORMALIZED-IF-EXPRP (NORMALIZE (LEFT-BRANCH X))))
	       (NORMALIZED-IF-EXPRP (NORMALIZE X))).

  This simplifies, applying RIGHT-BRANCH-CONS-IF, LEFT-BRANCH-CONS-IF,
  and TEST-CONS-IF, and opening up the definitions of NORMALIZE and
  NORMALIZED-IF-EXPRP, to:

        T.

Case 1. (IMPLIES (NOT (IF-EXPRP X))
		 (NORMALIZED-IF-EXPRP (NORMALIZE X))),

  which we simplify, opening up NORMALIZE and NORMALIZED-IF-EXPRP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.251993816 0.266007487 ]

NORMALIZE-NORMALIZES 


(PROVE-LEMMA TAUTOLOGY-CHECKER-COMPLETENESS-BRIDGE
	     (REWRITE)
	     (IMPLIES (AND (EQUAL (VALUE Y (FALSIFY1 X A))
				  (VALUE X (FALSIFY1 X A)))
			   (FALSIFY1 X A)
			   (NORMALIZED-IF-EXPRP X))
		      (EQUAL (VALUE Y (FALSIFY1 X A)) F)))
This conjecture simplifies, rewriting with the lemma
FALSIFY1-FALSIFIES, to:

      T.

Q.E.D.


[ 0.65997721 0.016023763 ]

TAUTOLOGY-CHECKER-COMPLETENESS-BRIDGE 


(PROVE-LEMMA TAUTOLOGY-CHECKER-IS-COMPLETE NIL
	     (IMPLIES (NOT (TAUTOLOGY-CHECKER X))
		      (EQUAL (VALUE X (FALSIFY X)) F)))
This conjecture can be simplified, using the abbreviations NOT,
IMPLIES, FALSIFY, and TAUTOLOGY-CHECKER, to:

      (IMPLIES (NOT (TAUTOLOGYP (NORMALIZE X) NIL))
	       (EQUAL (VALUE X
			     (FALSIFY1 (NORMALIZE X) NIL))
		      F)).

This simplifies, applying TAUTOLOGYP-FAILS-MEANS-FALSIFY1-WINS,
NORMALIZE-NORMALIZES, NORMALIZE-IS-SOUND, and
TAUTOLOGY-CHECKER-COMPLETENESS-BRIDGE, and expanding the definition
of EQUAL, to:

      T.

Q.E.D.


[ 0.55799968 0.0530110677 ]

TAUTOLOGY-CHECKER-IS-COMPLETE 


(PROVE-LEMMA TAUTOLOGY-CHECKER-SOUNDNESS-BRIDGE
	     (REWRITE)
	     (IMPLIES (AND (TAUTOLOGYP Y A1)
			   (NORMALIZED-IF-EXPRP Y)
			   (EQUAL (VALUE X A2)
				  (VALUE Y (APPEND A1 A2))))
		      (VALUE X A2)))

WARNING:  Note that TAUTOLOGY-CHECKER-SOUNDNESS-BRIDGE contains the
free variables A1 and Y which will be chosen by instantiating the
hypothesis (TAUTOLOGYP Y A1).

This simplifies, rewriting with TAUTOLOGYP-IS-SOUND, to:

      T.

Q.E.D.


[ 2.1169759 0.0150309245 ]

TAUTOLOGY-CHECKER-SOUNDNESS-BRIDGE 


(PROVE-LEMMA TAUTOLOGY-CHECKER-IS-SOUND NIL
	     (IMPLIES (TAUTOLOGY-CHECKER X)
		      (VALUE X A)))
This formula can be simplified, using the abbreviations IMPLIES and
TAUTOLOGY-CHECKER, to:

      (IMPLIES (TAUTOLOGYP (NORMALIZE X) NIL)
	       (VALUE X A)).

This simplifies, appealing to the lemmas NORMALIZE-IS-SOUND,
NORMALIZE-NORMALIZES, and TAUTOLOGY-CHECKER-SOUNDNESS-BRIDGE, and
expanding APPEND and LISTP, to:

      T.

Q.E.D.


[ 0.225 0.043994141 ]

TAUTOLOGY-CHECKER-IS-SOUND 


(MAKE-LIB P-TEMP)

[ 15.7839925 0.0 ]

(#FILE-OUT-|DSK:P-TEMP.LIB[BMP,SYS]|-71762 #FILE-OUT-|DSK:P-TEMP.LIS[BMP,SYS]|-71760) 


(NOTE-LIB P-TEMP.LIB P-TEMP.LISP)

[ 16.7739909 0.0 ]

#FILE-IN-|DSK:P-TEMP.LIB[BMP,SYS]|-71756 


(PROVE-LEMMA FLATTEN-SINGLETON
	     (REWRITE)
	     (EQUAL (EQUAL (FLATTEN X) (CONS Y NIL))
		    (AND (NLISTP X) (EQUAL X Y))))
This conjecture simplifies, applying CAR-CONS, and expanding NLISTP
and AND, to the following three new goals:

Case 3. (IMPLIES (EQUAL (FLATTEN X) (LIST Y))
		 (EQUAL (EQUAL X Y) T)),

  which again simplifies, rewriting with CAR-CONS, to:

        (IMPLIES (EQUAL (FLATTEN X) (LIST Y))
		 (EQUAL X Y)).

  Name the above subgoal *1.

Case 2. (IMPLIES (AND (NOT (EQUAL (FLATTEN X) (LIST Y)))
		      (NOT (LISTP X)))
		 (NOT (EQUAL X Y))),

  which we again simplify, opening up FLATTEN, to:

        T.

Case 1. (IMPLIES (EQUAL (FLATTEN X) (LIST Y))
		 (NOT (LISTP X))),

  which we would normally push and work on later by induction.  But
  if we must use induction to prove the input conjecture, we prefer
  to induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us consider:

(EQUAL (EQUAL (FLATTEN X) (LIST Y))
       (AND (NLISTP X) (EQUAL X Y))).

We gave this the name *1 above.  We will appeal to induction.  There
is only one suggested induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (LISTP X)
			 (P (CDR X) Y)
			 (P (CAR X) Y))
		    (P X Y))
	   (IMPLIES (NOT (LISTP X)) (P X Y))).
Linear arithmetic and the lemmas CDR-LESSP and CAR-LESSP inform us
that the measure (COUNT X) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme leads to the following two new formulas:

Case 2. (IMPLIES (AND (LISTP X)
		      (EQUAL (EQUAL (FLATTEN (CDR X)) (LIST Y))
			     (AND (NLISTP (CDR X))
				  (EQUAL (CDR X) Y)))
		      (EQUAL (EQUAL (FLATTEN (CAR X)) (LIST Y))
			     (AND (NLISTP (CAR X))
				  (EQUAL (CAR X) Y))))
		 (EQUAL (EQUAL (FLATTEN X) (LIST Y))
			(AND (NLISTP X) (EQUAL X Y)))),

  which we simplify, rewriting with the lemma CAR-CONS, and expanding
  the definitions of NLISTP, AND, and FLATTEN, to nine new
  conjectures:

  Case 2.9.
          (IMPLIES (AND (LISTP X)
			(NOT (EQUAL (FLATTEN (CDR X)) (LIST Y)))
			(LISTP (CDR X))
			(NOT (EQUAL (FLATTEN (CAR X)) (LIST Y)))
			(LISTP (CAR X)))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (FLATTEN (CDR X)))
			       (LIST Y)))).

    Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS V Z)
    to eliminate (CDR X) and (CAR X).  This produces:

          (IMPLIES (AND (NOT (EQUAL (FLATTEN Z) (LIST Y)))
			(LISTP Z)
			(NOT (EQUAL (FLATTEN V) (LIST Y)))
			(LISTP V))
		   (NOT (EQUAL (APPEND (FLATTEN V) (FLATTEN Z))
			       (LIST Y)))),

    which we generalize by replacing (FLATTEN V) by A and (FLATTEN Z)
    by U.  We restrict the new variables by recalling the type
    restriction lemma noted when FLATTEN was introduced.  This
    produces:

          (IMPLIES (AND (LISTP A)
			(LISTP U)
			(NOT (EQUAL U (LIST Y)))
			(LISTP Z)
			(NOT (EQUAL A (LIST Y)))
			(LISTP V))
		   (NOT (EQUAL (APPEND A U) (LIST Y)))).

    Eliminate irrelevant terms.  This generates:

          (IMPLIES (AND (LISTP A)
			(LISTP U)
			(NOT (EQUAL U (LIST Y)))
			(NOT (EQUAL A (LIST Y))))
		   (NOT (EQUAL (APPEND A U) (LIST Y)))).

    Give the above formula the name *1.1.

  Case 2.8.
          (IMPLIES (AND (LISTP X)
			(NOT (EQUAL (FLATTEN (CDR X)) (LIST Y)))
			(LISTP (CDR X))
			(NOT (EQUAL (FLATTEN (CAR X)) (LIST Y)))
			(NOT (EQUAL (CAR X) Y)))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (FLATTEN (CDR X)))
			       (LIST Y)))).

    Applying the lemma CAR-CDR-ELIM, replace X by (CONS V Z) to
    eliminate (CDR X) and (CAR X).  We would thus like to prove the
    formula:

          (IMPLIES (AND (NOT (EQUAL (FLATTEN Z) (LIST Y)))
			(LISTP Z)
			(NOT (EQUAL (FLATTEN V) (LIST Y)))
			(NOT (EQUAL V Y)))
		   (NOT (EQUAL (APPEND (FLATTEN V) (FLATTEN Z))
			       (LIST Y)))),

    which we generalize by replacing (FLATTEN V) by A and (FLATTEN Z)
    by U.  We restrict the new variables by appealing to the type
    restriction lemma noted when FLATTEN was introduced.  We must
    thus prove:

          (IMPLIES (AND (LISTP A)
			(LISTP U)
			(NOT (EQUAL U (LIST Y)))
			(LISTP Z)
			(NOT (EQUAL A (LIST Y)))
			(NOT (EQUAL V Y)))
		   (NOT (EQUAL (APPEND A U) (LIST Y)))),

    which has an irrelevant term in it.  By eliminating the term we
    get the new conjecture:

          (IMPLIES (AND (LISTP A)
			(LISTP U)
			(NOT (EQUAL U (LIST Y)))
			(NOT (EQUAL A (LIST Y)))
			(NOT (EQUAL V Y)))
		   (NOT (EQUAL (APPEND A U) (LIST Y)))),

    which we will name *1.2.

  Case 2.7.
          (IMPLIES (AND (LISTP X)
			(NOT (EQUAL (FLATTEN (CDR X)) (LIST Y)))
			(LISTP (CDR X))
			(EQUAL (FLATTEN (CAR X)) (LIST Y))
			(NOT (LISTP (CAR X)))
			(EQUAL (EQUAL (CAR X) Y) T))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (FLATTEN (CDR X)))
			       (FLATTEN (CAR X))))).

    This again simplifies, rewriting with the lemma CAR-CONS, to:

          (IMPLIES (AND (LISTP X)
			(NOT (EQUAL (FLATTEN (CDR X))
				    (FLATTEN (CAR X))))
			(LISTP (CDR X))
			(EQUAL (FLATTEN (CAR X)) (LIST Y))
			(NOT (LISTP (CAR X)))
			(EQUAL (CAR X) Y))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (FLATTEN (CDR X)))
			       (FLATTEN (CAR X))))),

    which again simplifies, applying CAR-CONS, to the new conjecture:

          (IMPLIES (AND (LISTP X)
			(NOT (EQUAL (FLATTEN (CDR X))
				    (FLATTEN (CAR X))))
			(LISTP (CDR X))
			(EQUAL (FLATTEN (CAR X))
			       (LIST (CAR X)))
			(NOT (LISTP (CAR X))))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (FLATTEN (CDR X)))
			       (FLATTEN (CAR X))))),

    which we further simplify, appealing to the lemmas CDR-CONS and
    CAR-CONS, and expanding the functions FLATTEN, APPEND, and LISTP,
    to:

          T.

  Case 2.6.
          (IMPLIES (AND (LISTP X)
			(NOT (EQUAL (FLATTEN (CDR X)) (LIST Y)))
			(NOT (EQUAL (CDR X) Y))
			(NOT (EQUAL (FLATTEN (CAR X)) (LIST Y)))
			(LISTP (CAR X)))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (FLATTEN (CDR X)))
			       (LIST Y)))).

    Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS V Z)
    to eliminate (CDR X) and (CAR X).  This produces the formula:

          (IMPLIES (AND (NOT (EQUAL (FLATTEN Z) (LIST Y)))
			(NOT (EQUAL Z Y))
			(NOT (EQUAL (FLATTEN V) (LIST Y)))
			(LISTP V))
		   (NOT (EQUAL (APPEND (FLATTEN V) (FLATTEN Z))
			       (LIST Y)))).

    We will try to prove the above conjecture by generalizing it,
    replacing (FLATTEN V) by A and (FLATTEN Z) by U.  We restrict the
    new variables by appealing to the type restriction lemma noted
    when FLATTEN was introduced.  The result is the new conjecture:

          (IMPLIES (AND (LISTP A)
			(LISTP U)
			(NOT (EQUAL U (LIST Y)))
			(NOT (EQUAL Z Y))
			(NOT (EQUAL A (LIST Y)))
			(LISTP V))
		   (NOT (EQUAL (APPEND A U) (LIST Y)))).

    Eliminate the irrelevant term.  We must thus prove:

          (IMPLIES (AND (LISTP A)
			(LISTP U)
			(NOT (EQUAL U (LIST Y)))
			(NOT (EQUAL Z Y))
			(NOT (EQUAL A (LIST Y))))
		   (NOT (EQUAL (APPEND A U) (LIST Y)))).

    Give the above formula the name *1.3.

  Case 2.5.
          (IMPLIES (AND (LISTP X)
			(NOT (EQUAL (FLATTEN (CDR X)) (LIST Y)))
			(NOT (EQUAL (CDR X) Y))
			(NOT (EQUAL (FLATTEN (CAR X)) (LIST Y)))
			(NOT (EQUAL (CAR X) Y)))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (FLATTEN (CDR X)))
			       (LIST Y)))).

    Appealing to the lemma CAR-CDR-ELIM, we now replace X by
    (CONS V Z) to eliminate (CDR X) and (CAR X).  This generates:

          (IMPLIES (AND (NOT (EQUAL (FLATTEN Z) (LIST Y)))
			(NOT (EQUAL Z Y))
			(NOT (EQUAL (FLATTEN V) (LIST Y)))
			(NOT (EQUAL V Y)))
		   (NOT (EQUAL (APPEND (FLATTEN V) (FLATTEN Z))
			       (LIST Y)))),

    which we generalize by replacing (FLATTEN V) by A and (FLATTEN Z)
    by U.  We restrict the new variables by appealing to the type
    restriction lemma noted when FLATTEN was introduced.  We would
    thus like to prove:

          (IMPLIES (AND (LISTP A)
			(LISTP U)
			(NOT (EQUAL U (LIST Y)))
			(NOT (EQUAL Z Y))
			(NOT (EQUAL A (LIST Y)))
			(NOT (EQUAL V Y)))
		   (NOT (EQUAL (APPEND A U) (LIST Y)))).

    Give the above formula the name *1.4.

  Case 2.4.
          (IMPLIES (AND (LISTP X)
			(NOT (EQUAL (FLATTEN (CDR X)) (LIST Y)))
			(NOT (EQUAL (CDR X) Y))
			(EQUAL (FLATTEN (CAR X)) (LIST Y))
			(NOT (LISTP (CAR X)))
			(EQUAL (EQUAL (CAR X) Y) T))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (FLATTEN (CDR X)))
			       (FLATTEN (CAR X))))).

    However this again simplifies, applying CAR-CONS, to:

          (IMPLIES (AND (LISTP X)
			(NOT (EQUAL (FLATTEN (CDR X))
				    (FLATTEN (CAR X))))
			(NOT (EQUAL (CDR X) Y))
			(EQUAL (FLATTEN (CAR X)) (LIST Y))
			(NOT (LISTP (CAR X)))
			(EQUAL (CAR X) Y))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (FLATTEN (CDR X)))
			       (FLATTEN (CAR X))))).

    This simplifies again, rewriting with the lemma CAR-CONS, to:

          (IMPLIES (AND (LISTP X)
			(NOT (EQUAL (FLATTEN (CDR X))
				    (FLATTEN (CAR X))))
			(NOT (EQUAL (CDR X) (CAR X)))
			(EQUAL (FLATTEN (CAR X))
			       (LIST (CAR X)))
			(NOT (LISTP (CAR X))))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (FLATTEN (CDR X)))
			       (FLATTEN (CAR X))))).

    However this simplifies further, applying CDR-CONS and CAR-CONS,
    and opening up FLATTEN, APPEND, and LISTP, to:

          T.

  Case 2.3.
          (IMPLIES (AND (LISTP X)
			(EQUAL (FLATTEN (CDR X)) (LIST Y))
			(NOT (LISTP (CDR X)))
			(EQUAL (EQUAL (CDR X) Y) T)
			(NOT (EQUAL (FLATTEN (CAR X))
				    (FLATTEN (CDR X))))
			(LISTP (CAR X)))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (FLATTEN (CDR X)))
			       (FLATTEN (CDR X))))).

    But this simplifies again, rewriting with the lemma CAR-CONS, to:

          (IMPLIES (AND (LISTP X)
			(EQUAL (FLATTEN (CDR X)) (LIST Y))
			(NOT (LISTP (CDR X)))
			(EQUAL (CDR X) Y)
			(NOT (EQUAL (FLATTEN (CAR X))
				    (FLATTEN (CDR X))))
			(LISTP (CAR X)))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (FLATTEN (CDR X)))
			       (FLATTEN (CDR X))))),

    which again simplifies, applying the lemma CAR-CONS, to:

          (IMPLIES (AND (LISTP X)
			(EQUAL (FLATTEN (CDR X))
			       (LIST (CDR X)))
			(NOT (LISTP (CDR X)))
			(NOT (EQUAL (FLATTEN (CAR X))
				    (FLATTEN (CDR X))))
			(LISTP (CAR X)))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (FLATTEN (CDR X)))
			       (FLATTEN (CDR X))))).

    This simplifies further, rewriting with the lemma CAR-CONS, and
    unfolding the definition of FLATTEN, to:

          (IMPLIES (AND (LISTP X)
			(NOT (LISTP (CDR X)))
			(NOT (EQUAL (FLATTEN (CAR X))
				    (LIST (CDR X))))
			(LISTP (CAR X)))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (LIST (CDR X)))
			       (LIST (CDR X))))).

    Appealing to the lemma CAR-CDR-ELIM, we now replace X by
    (CONS V Z) to eliminate (CDR X) and (CAR X).  This generates:

          (IMPLIES (AND (NOT (LISTP Z))
			(NOT (EQUAL (FLATTEN V) (LIST Z)))
			(LISTP V))
		   (NOT (EQUAL (APPEND (FLATTEN V) (LIST Z))
			       (LIST Z)))),

    which we generalize by replacing (FLATTEN V) by A.  We restrict
    the new variable by recalling the type restriction lemma noted
    when FLATTEN was introduced.  We must thus prove:

          (IMPLIES (AND (LISTP A)
			(NOT (LISTP Z))
			(NOT (EQUAL A (LIST Z)))
			(LISTP V))
		   (NOT (EQUAL (APPEND A (LIST Z))
			       (LIST Z)))).

    Eliminate the irrelevant term.  We would thus like to prove:

          (IMPLIES (AND (LISTP A)
			(NOT (LISTP Z))
			(NOT (EQUAL A (LIST Z))))
		   (NOT (EQUAL (APPEND A (LIST Z))
			       (LIST Z)))),

    which we will finally name *1.5.

  Case 2.2.
          (IMPLIES (AND (LISTP X)
			(EQUAL (FLATTEN (CDR X)) (LIST Y))
			(NOT (LISTP (CDR X)))
			(EQUAL (EQUAL (CDR X) Y) T)
			(NOT (EQUAL (FLATTEN (CAR X))
				    (FLATTEN (CDR X))))
			(NOT (EQUAL (CAR X) Y)))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (FLATTEN (CDR X)))
			       (FLATTEN (CDR X))))).

    But this again simplifies, appealing to the lemma CAR-CONS, to:

          (IMPLIES (AND (LISTP X)
			(EQUAL (FLATTEN (CDR X)) (LIST Y))
			(NOT (LISTP (CDR X)))
			(EQUAL (CDR X) Y)
			(NOT (EQUAL (FLATTEN (CAR X))
				    (FLATTEN (CDR X))))
			(NOT (EQUAL (CAR X) Y)))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (FLATTEN (CDR X)))
			       (FLATTEN (CDR X))))).

    However this simplifies again, applying CAR-CONS, to:

          (IMPLIES (AND (LISTP X)
			(EQUAL (FLATTEN (CDR X))
			       (LIST (CDR X)))
			(NOT (LISTP (CDR X)))
			(NOT (EQUAL (FLATTEN (CAR X))
				    (FLATTEN (CDR X))))
			(NOT (EQUAL (CAR X) (CDR X))))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (FLATTEN (CDR X)))
			       (FLATTEN (CDR X))))).

    But this simplifies further, appealing to the lemma CAR-CONS, and
    unfolding FLATTEN, to the new goal:

          (IMPLIES (AND (LISTP X)
			(NOT (LISTP (CDR X)))
			(NOT (EQUAL (FLATTEN (CAR X))
				    (LIST (CDR X))))
			(NOT (EQUAL (CAR X) (CDR X))))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (LIST (CDR X)))
			       (LIST (CDR X))))).

    Appealing to the lemma CAR-CDR-ELIM, replace X by (CONS V Z) to
    eliminate (CDR X) and (CAR X).  We must thus prove:

          (IMPLIES (AND (NOT (LISTP Z))
			(NOT (EQUAL (FLATTEN V) (LIST Z)))
			(NOT (EQUAL V Z)))
		   (NOT (EQUAL (APPEND (FLATTEN V) (LIST Z))
			       (LIST Z)))).

    We will try to prove the above conjecture by generalizing it,
    replacing (FLATTEN V) by A.  We restrict the new variable by
    appealing to the type restriction lemma noted when FLATTEN was
    introduced.  This generates the formula:

          (IMPLIES (AND (LISTP A)
			(NOT (LISTP Z))
			(NOT (EQUAL A (LIST Z)))
			(NOT (EQUAL V Z)))
		   (NOT (EQUAL (APPEND A (LIST Z))
			       (LIST Z)))).

    Finally call the above conjecture *1.6.

  Case 2.1.
          (IMPLIES (AND (LISTP X)
			(EQUAL (FLATTEN (CDR X)) (LIST Y))
			(NOT (LISTP (CDR X)))
			(EQUAL (EQUAL (CDR X) Y) T)
			(EQUAL (FLATTEN (CAR X))
			       (FLATTEN (CDR X)))
			(NOT (LISTP (CAR X)))
			(EQUAL (EQUAL (CAR X) Y) T))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (FLATTEN (CAR X)))
			       (FLATTEN (CDR X))))).

    But this again simplifies, applying CAR-CONS, to the formula:

          (IMPLIES (AND (LISTP X)
			(EQUAL (FLATTEN (CAR X)) (LIST Y))
			(NOT (LISTP (CDR X)))
			(EQUAL (CDR X) Y)
			(EQUAL (FLATTEN (CAR X))
			       (FLATTEN (CDR X)))
			(NOT (LISTP (CAR X)))
			(EQUAL (CAR X) Y))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (FLATTEN (CAR X)))
			       (FLATTEN (CAR X))))),

    which again simplifies, rewriting with CAR-CONS, to:

          (IMPLIES (AND (LISTP X)
			(EQUAL (FLATTEN (CAR X))
			       (LIST (CAR X)))
			(EQUAL (FLATTEN (CAR X))
			       (FLATTEN (CDR X)))
			(NOT (LISTP (CAR X)))
			(EQUAL (CAR X) (CDR X)))
		   (NOT (EQUAL (APPEND (FLATTEN (CAR X))
				       (FLATTEN (CAR X)))
			       (FLATTEN (CAR X))))),

    which we further simplify, applying CDR-CONS and CAR-CONS, and
    expanding FLATTEN, APPEND, and LISTP, to:

          T.

Case 1. (IMPLIES (NOT (LISTP X))
		 (EQUAL (EQUAL (FLATTEN X) (LIST Y))
			(AND (NLISTP X) (EQUAL X Y)))),

  which simplifies, applying CAR-CONS and CONS-EQUAL, and opening up
  the functions FLATTEN, EQUAL, NLISTP, and AND, to:

        T.


     So let us turn our attention to:

      (IMPLIES (AND (LISTP A)
		    (NOT (LISTP Z))
		    (NOT (EQUAL A (LIST Z)))
		    (NOT (EQUAL V Z)))
	       (NOT (EQUAL (APPEND A (LIST Z))
			   (LIST Z)))),

which is formula *1.6 above.  What luck!  This conjecture is subsumed
by another subgoal awaiting our attention, namely *1.5 above.


     So let us turn our attention to:

      (IMPLIES (AND (LISTP A)
		    (NOT (LISTP Z))
		    (NOT (EQUAL A (LIST Z))))
	       (NOT (EQUAL (APPEND A (LIST Z))
			   (LIST Z)))),

which we named *1.5 above.  We will try to prove it by induction.
There is only one suggested induction.  We will induct according to
the following scheme:
      (AND (IMPLIES (AND (LISTP A) (P (CDR A) Z))
		    (P A Z))
	   (IMPLIES (NOT (LISTP A)) (P A Z))).
Linear arithmetic and the lemma CDR-LESSP can be used to show that
the measure (COUNT A) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme leads to the following three new formulas:

Case 3. (IMPLIES (AND (NOT (LISTP (CDR A)))
		      (LISTP A)
		      (NOT (LISTP Z))
		      (NOT (EQUAL A (LIST Z))))
		 (NOT (EQUAL (APPEND A (LIST Z))
			     (LIST Z)))).

  This simplifies, applying the lemmas CAR-CONS and CONS-EQUAL, and
  expanding the definition of APPEND, to:

        T.

Case 2. (IMPLIES (AND (EQUAL (CDR A) (LIST Z))
		      (LISTP A)
		      (NOT (LISTP Z))
		      (NOT (EQUAL A (LIST Z))))
		 (NOT (EQUAL (APPEND A (LIST Z))
			     (LIST Z)))).

  This simplifies, rewriting with CAR-CONS, and unfolding APPEND, to:

        (IMPLIES (AND (EQUAL (CDR A) (LIST Z))
		      (LISTP A)
		      (NOT (LISTP Z))
		      (NOT (EQUAL A (CDR A))))
		 (NOT (EQUAL (CONS (CAR A)
				   (APPEND (CDR A) (CDR A)))
			     (CDR A)))).

  Appealing to the lemma CAR-CDR-ELIM, we now replace A by (CONS V X)
  to eliminate (CDR A) and (CAR A).  The result is:

        (IMPLIES (AND (EQUAL X (LIST Z))
		      (NOT (LISTP Z))
		      (NOT (EQUAL (CONS V X) X)))
		 (NOT (EQUAL (CONS V (APPEND X X)) X))),

  which we further simplify, applying the lemmas CAR-CONS, CONS-EQUAL,
  and CDR-CONS, and opening up the functions APPEND and LISTP, to:

        T.

Case 1. (IMPLIES (AND (NOT (EQUAL (APPEND (CDR A) (LIST Z))
				  (LIST Z)))
		      (LISTP A)
		      (NOT (LISTP Z))
		      (NOT (EQUAL A (LIST Z))))
		 (NOT (EQUAL (APPEND A (LIST Z))
			     (LIST Z)))),

  which simplifies, rewriting with CAR-CONS and CONS-EQUAL, and
  opening up the function APPEND, to:

        T.


     That finishes the proof of *1.5.


     So next consider:

      (IMPLIES (AND (LISTP A)
		    (LISTP U)
		    (NOT (EQUAL U (LIST Y)))
		    (NOT (EQUAL Z Y))
		    (NOT (EQUAL A (LIST Y)))
		    (NOT (EQUAL V Y)))
	       (NOT (EQUAL (APPEND A U) (LIST Y)))),

which is formula *1.4 above.  Ah ha!  This conjecture is subsumed by
another subgoal awaiting our attention, namely *1.3 above.


     So we now return to:

      (IMPLIES (AND (LISTP A)
		    (LISTP U)
		    (NOT (EQUAL U (LIST Y)))
		    (NOT (EQUAL Z Y))
		    (NOT (EQUAL A (LIST Y))))
	       (NOT (EQUAL (APPEND A U) (LIST Y)))),

which we named *1.3 above.  But this conjecture is subsumed by
another subgoal awaiting our attention, namely *1.2 above.


     So let us turn our attention to:

      (IMPLIES (AND (LISTP A)
		    (LISTP U)
		    (NOT (EQUAL U (LIST Y)))
		    (NOT (EQUAL A (LIST Y)))
		    (NOT (EQUAL V Y)))
	       (NOT (EQUAL (APPEND A U) (LIST Y)))),

named *1.2 above.  But this conjecture is subsumed by another subgoal
awaiting our attention, namely *1.1 above.


     So we now return to:

      (IMPLIES (AND (LISTP A)
		    (LISTP U)
		    (NOT (EQUAL U (LIST Y)))
		    (NOT (EQUAL A (LIST Y))))
	       (NOT (EQUAL (APPEND A U) (LIST Y)))),

which is formula *1.1 above.  Let us appeal to the induction
principle.  There is only one plausible induction.  We will induct
according to the following scheme:
      (AND (IMPLIES (AND (LISTP A) (P (CDR A) U Y))
		    (P A U Y))
	   (IMPLIES (NOT (LISTP A)) (P A U Y))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT A) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
generates three new formulas:

Case 3. (IMPLIES (AND (NOT (LISTP (CDR A)))
		      (LISTP A)
		      (LISTP U)
		      (NOT (EQUAL U (LIST Y)))
		      (NOT (EQUAL A (LIST Y))))
		 (NOT (EQUAL (APPEND A U) (LIST Y)))),

  which simplifies, rewriting with CAR-CONS and CONS-EQUAL, and
  opening up the definition of APPEND, to:

        T.

Case 2. (IMPLIES (AND (EQUAL (CDR A) (LIST Y))
		      (LISTP A)
		      (LISTP U)
		      (NOT (EQUAL U (LIST Y)))
		      (NOT (EQUAL A (LIST Y))))
		 (NOT (EQUAL (APPEND A U) (LIST Y)))).

  This simplifies, rewriting with CAR-CONS, and unfolding the
  definition of APPEND, to:

        (IMPLIES (AND (EQUAL (CDR A) (LIST Y))
		      (LISTP A)
		      (LISTP U)
		      (NOT (EQUAL U (CDR A)))
		      (NOT (EQUAL A (CDR A))))
		 (NOT (EQUAL (CONS (CAR A) (APPEND (CDR A) U))
			     (CDR A)))).

  Appealing to the lemma CAR-CDR-ELIM, replace A by (CONS Z X) to
  eliminate (CDR A) and (CAR A).  This generates the new conjecture:

        (IMPLIES (AND (EQUAL X (LIST Y))
		      (LISTP U)
		      (NOT (EQUAL U X))
		      (NOT (EQUAL (CONS Z X) X)))
		 (NOT (EQUAL (CONS Z (APPEND X U)) X))),

  which we further simplify, applying the lemmas CAR-CONS, CONS-EQUAL,
  and CDR-CONS, and opening up APPEND and LISTP, to:

        T.

Case 1. (IMPLIES (AND (NOT (EQUAL (APPEND (CDR A) U) (LIST Y)))
		      (LISTP A)
		      (LISTP U)
		      (NOT (EQUAL U (LIST Y)))
		      (NOT (EQUAL A (LIST Y))))
		 (NOT (EQUAL (APPEND A U) (LIST Y)))),

  which we simplify, rewriting with CAR-CONS and CONS-EQUAL, and
  expanding APPEND, to:

        T.


     That finishes the proof of *1.1, which, in turn, finishes the
proof of *1.  Q.E.D.


[ 19.5469239 3.2940918 ]

FLATTEN-SINGLETON 


(DEFN LEFTCOUNT
      (X)
      (IF (NLISTP X)
	  0.
	  (ADD1 (LEFTCOUNT (CAR X)))))
     Linear arithmetic, the lemmas CAR-LESSEQP and CAR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, LEFTCOUNT is accepted under the principle of definition.
Observe that (NUMBERP (LEFTCOUNT X)) is a theorem.




[ 2.59698895 0.0530110677 ]

LEFTCOUNT 


(DEFN GOPHER
      (X)
      (IF (OR (NLISTP X) (NLISTP (CAR X)))
	  X
	  (GOPHER (CONS (CAAR X)
			(CONS (CDAR X) (CDR X)))))
      ((LESSP (LEFTCOUNT X))))
     Linear arithmetic, the lemmas SUB1-ADD1 and CAR-CONS, and the
definitions of LESSP, LEFTCOUNT, OR, and NLISTP can be used to
establish that the measure (LEFTCOUNT X) decreases according to the
well-founded relation LESSP in each recursive call.  Hence, GOPHER is
accepted under the definitional principle.  Observe that:
      (OR (LISTP (GOPHER X))
	  (EQUAL (GOPHER X) X))
is a theorem.




[ 0.9139974 0.063997396 ]

GOPHER 


(PROVE-LEMMA GOPHER-PRESERVES-COUNT
	     (REWRITE)
	     ( LEQ (COUNT (GOPHER X)) (COUNT X)))

     Call the conjecture *1.


     Perhaps we can prove it by induction.  There is only one
plausible induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (OR (NLISTP X) (NLISTP (CAR X)))
		    (P X))
	   (IMPLIES (AND (NOT (OR (NLISTP X) (NLISTP (CAR X))))
			 (P (CONS (CAAR X)
				  (CONS (CDAR X) (CDR X)))))
		    (P X))).
Linear arithmetic, the lemmas SUB1-ADD1 and CAR-CONS, and the
definitions of LESSP, LEFTCOUNT, OR, and NLISTP establish that the
measure (LEFTCOUNT X) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme produces two new formulas:

Case 2. (IMPLIES (OR (NLISTP X) (NLISTP (CAR X)))
		 ( LEQ (COUNT (GOPHER X)) (COUNT X))).

  This simplifies, expanding the definitions of NLISTP, OR, and
  GOPHER, to two new goals:

  Case 2.2.
          (IMPLIES (NOT (LISTP X))
		   ( LEQ (COUNT X) (COUNT X))),

    which we again simplify, using linear arithmetic, to:

          T.

  Case 2.1.
          (IMPLIES (NOT (LISTP (CAR X)))
		   ( LEQ (COUNT X) (COUNT X))).

    However this simplifies again, using linear arithmetic, to:

          T.

Case 1. (IMPLIES
		(AND (NOT (OR (NLISTP X) (NLISTP (CAR X))))
		     ( LEQ
		       (COUNT (GOPHER (CONS (CAAR X)
					    (CONS (CDAR X) (CDR X)))))
		       (COUNT (CONS (CAAR X)
				    (CONS (CDAR X) (CDR X))))))
		( LEQ (COUNT (GOPHER X)) (COUNT X))).

  This simplifies, applying COMMUTATIVITY-OF-PLUS, COUNT-CONS,
  COMMUTATIVITY2-OF-PLUS, PLUS-ADD1, and SUB1-ADD1, and expanding the
  functions NLISTP, OR, LESSP, GOPHER, and EQUAL, to the following
  two new formulas:

  Case 1.2.
          (IMPLIES
	   (AND
	    (LISTP X)
	    (LISTP (CAR X))
	    (EQUAL
		(SUB1 (COUNT (GOPHER (CONS (CAAR X)
					   (CONS (CDAR X) (CDR X))))))
		0)
	    (NOT
		(EQUAL (COUNT (GOPHER (CONS (CAAR X)
					    (CONS (CDAR X) (CDR X)))))
		       0)))
	   (NOT (EQUAL (COUNT X) 0))).

    Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
    eliminate (CAR X) and (CDR X) and Z by (CONS W D) to eliminate
    (CAR Z) and (CDR Z).  This produces the goal:

          (IMPLIES
	       (AND (EQUAL (SUB1 (COUNT (GOPHER (CONS W (CONS D V)))))
			   0)
		    (NOT (EQUAL (COUNT (GOPHER (CONS W (CONS D V))))
				0)))
	       (NOT (EQUAL (COUNT (CONS (CONS W D) V))
			   0))),

    which further simplifies, rewriting with COMMUTATIVITY-OF-PLUS,
    COUNT-CONS, COMMUTATIVITY2-OF-PLUS, and PLUS-ADD1, to:

          T.

  Case 1.1.
          (IMPLIES
	   (AND
	    (LISTP X)
	    (LISTP (CAR X))
	    ( LEQ
	     (SUB1
	       (SUB1 (COUNT (GOPHER (CONS (CAAR X)
					  (CONS (CDAR X) (CDR X)))))))
	     (PLUS (COUNT (CDR X))
		   (PLUS (COUNT (CAAR X))
			 (COUNT (CDAR X))))))
	   ( LEQ
	     (COUNT (GOPHER (CONS (CAAR X)
				  (CONS (CDAR X) (CDR X)))))
	     (COUNT X))).

    Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V)
    to eliminate (CAR X) and (CDR X) and Z by (CONS W D) to eliminate
    (CAR Z) and (CDR Z).  We thus obtain:

          (IMPLIES
		  ( LEQ
		    (SUB1 (SUB1 (COUNT (GOPHER (CONS W (CONS D V))))))
		    (PLUS (COUNT V)
			  (PLUS (COUNT W) (COUNT D))))
		  ( LEQ
		    (COUNT (GOPHER (CONS W (CONS D V))))
		    (COUNT (CONS (CONS W D) V)))),

    which further simplifies, applying COMMUTATIVITY-OF-PLUS,
    COMMUTATIVITY2-OF-PLUS, COUNT-CONS, PLUS-ADD1, and SUB1-ADD1, and
    expanding the function LESSP, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 7.55397135 0.5340332 ]

GOPHER-PRESERVES-COUNT 


(PROVE-LEMMA LISTP-GOPHER
	     (REWRITE)
	     (EQUAL (LISTP (GOPHER X)) (LISTP X)))

     Name the conjecture *1.


     Perhaps we can prove it by induction.  There is only one
plausible induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (OR (NLISTP X) (NLISTP (CAR X)))
		    (P X))
	   (IMPLIES (AND (NOT (OR (NLISTP X) (NLISTP (CAR X))))
			 (P (CONS (CAAR X)
				  (CONS (CDAR X) (CDR X)))))
		    (P X))).
Linear arithmetic, the lemmas SUB1-ADD1 and CAR-CONS, and the
definitions of LESSP, LEFTCOUNT, OR, and NLISTP inform us that the
measure (LEFTCOUNT X) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme produces two new formulas:

Case 2. (IMPLIES (OR (NLISTP X) (NLISTP (CAR X)))
		 (EQUAL (LISTP (GOPHER X)) (LISTP X))).

  This simplifies, opening up the definitions of NLISTP, OR, GOPHER,
  and EQUAL, to:

        T.

Case 1. (IMPLIES (NOT (OR (NLISTP X) (NLISTP (CAR X))))
		 (EQUAL (LISTP (GOPHER X)) (LISTP X))),

  which we simplify, opening up NLISTP, OR, GOPHER, and EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.159033203 0.15797526 ]

LISTP-GOPHER 


(DEFN SAMEFRINGE
      (X Y)
      (IF (OR (NLISTP X) (NLISTP Y))
	  (EQUAL X Y)
	  (AND (EQUAL (CAR (GOPHER X))
		      (CAR (GOPHER Y)))
	       (SAMEFRINGE (CDR (GOPHER X))
			   (CDR (GOPHER Y))))))
     Linear arithmetic, the lemmas CDR-LESSEQP,
GOPHER-PRESERVES-COUNT, LISTP-GOPHER, and CDR-LESSP, and the
definitions of OR and NLISTP inform us that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each
recursive call.  Hence, SAMEFRINGE is accepted under the definitional
principle.  The definition of SAMEFRINGE can be justified in another
way.  Linear arithmetic, the lemmas CDR-LESSEQP,
GOPHER-PRESERVES-COUNT, LISTP-GOPHER, and CDR-LESSP, and the
definitions of OR and NLISTP inform us that the measure (COUNT Y)
decreases according to the well-founded relation LESSP in each
recursive call.  From the definition we can conclude that:
      (OR (FALSEP (SAMEFRINGE X Y))
	  (TRUEP (SAMEFRINGE X Y)))
is a theorem.




[ 1.32597657 0.10600586 ]

SAMEFRINGE 


(PROVE-LEMMA GOPHER-RETURNS-LEFTMOST-ATOM
	     (REWRITE)
	     (EQUAL (CAR (GOPHER X))
		    (IF (LISTP X) (CAR (FLATTEN X)) 0.)))
This simplifies, trivially, to two new conjectures:

Case 2. (IMPLIES (NOT (LISTP X))
		 (EQUAL (CAR (GOPHER X)) 0)).

  However this again simplifies, applying the lemma CAR-NLISTP, and
  unfolding GOPHER and EQUAL, to:

        T.

Case 1. (IMPLIES (LISTP X)
		 (EQUAL (CAR (GOPHER X))
			(CAR (FLATTEN X)))),

  which we will name *1.


     We will appeal to induction.  Two inductions are suggested by
terms in the conjecture, both of which are unflawed.  So we will
choose the one suggested by the largest number of nonprimitive
recursive functions.  We will induct according to the following
scheme:
      (AND (IMPLIES (OR (NLISTP X) (NLISTP (CAR X)))
		    (P X))
	   (IMPLIES (AND (NOT (OR (NLISTP X) (NLISTP (CAR X))))
			 (P (CONS (CAAR X)
				  (CONS (CDAR X) (CDR X)))))
		    (P X))).
Linear arithmetic, the lemmas SUB1-ADD1 and CAR-CONS, and the
definitions of LESSP, LEFTCOUNT, OR, and NLISTP establish that the
measure (LEFTCOUNT X) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme generates two new formulas:

Case 2. (IMPLIES (AND (OR (NLISTP X) (NLISTP (CAR X)))
		      (LISTP X))
		 (EQUAL (CAR (GOPHER X))
			(CAR (FLATTEN X)))),

  which we simplify, unfolding NLISTP, OR, and GOPHER, to the goal:

        (IMPLIES (AND (NOT (LISTP (CAR X))) (LISTP X))
		 (EQUAL (CAR X) (CAR (FLATTEN X)))).

  Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
  eliminate (CAR X) and (CDR X).  This produces:

        (IMPLIES (NOT (LISTP Z))
		 (EQUAL Z (CAR (FLATTEN (CONS Z V))))),

  which we further simplify, rewriting with CDR-CONS and CAR-CONS,
  and expanding the definitions of FLATTEN, APPEND, and LISTP, to:

        T.

Case 1. (IMPLIES
	   (AND (NOT (OR (NLISTP X) (NLISTP (CAR X))))
		(EQUAL (CAR (GOPHER (CONS (CAAR X)
					  (CONS (CDAR X) (CDR X)))))
		       (CAR (FLATTEN (CONS (CAAR X)
					   (CONS (CDAR X) (CDR X))))))
		(LISTP X))
	   (EQUAL (CAR (GOPHER X))
		  (CAR (FLATTEN X)))),

  which we simplify, rewriting with the lemmas CDR-CONS, CAR-CONS,
  and ASSOCIATIVITY-OF-APPEND, and unfolding NLISTP, OR, FLATTEN, and
  GOPHER, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.01598307 0.33601888 ]

GOPHER-RETURNS-LEFTMOST-ATOM 


(PROVE-LEMMA GOPHER-RETURNS-CORRECT-STATE
	     (REWRITE)
	     (EQUAL (FLATTEN (CDR (GOPHER X)))
		    (IF (LISTP X)
			(CDR (FLATTEN X))
			(CONS 0. NIL))))
This simplifies, trivially, to two new conjectures:

Case 2. (IMPLIES (NOT (LISTP X))
		 (EQUAL (FLATTEN (CDR (GOPHER X)))
			'(0))).

  However this again simplifies, applying the lemma CDR-NLISTP, and
  expanding the definitions of GOPHER, FLATTEN, and EQUAL, to:

        T.

Case 1. (IMPLIES (LISTP X)
		 (EQUAL (FLATTEN (CDR (GOPHER X)))
			(CDR (FLATTEN X)))),

  which we will name *1.


     We will appeal to induction.  There are two plausible inductions,
both of which are unflawed.  So we will choose the one suggested by
the largest number of nonprimitive recursive functions.  We will
induct according to the following scheme:
      (AND (IMPLIES (OR (NLISTP X) (NLISTP (CAR X)))
		    (P X))
	   (IMPLIES (AND (NOT (OR (NLISTP X) (NLISTP (CAR X))))
			 (P (CONS (CAAR X)
				  (CONS (CDAR X) (CDR X)))))
		    (P X))).
Linear arithmetic, the lemmas SUB1-ADD1 and CAR-CONS, and the
definitions of LESSP, LEFTCOUNT, OR, and NLISTP establish that the
measure (LEFTCOUNT X) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme leads to the following two new conjectures:

Case 2. (IMPLIES (AND (OR (NLISTP X) (NLISTP (CAR X)))
		      (LISTP X))
		 (EQUAL (FLATTEN (CDR (GOPHER X)))
			(CDR (FLATTEN X)))).

  This simplifies, expanding the definitions of NLISTP, OR, and
  GOPHER, to the formula:

        (IMPLIES (AND (NOT (LISTP (CAR X))) (LISTP X))
		 (EQUAL (FLATTEN (CDR X))
			(CDR (FLATTEN X)))),

  which again simplifies, rewriting with CDR-CONS and CAR-CONS, and
  opening up the functions FLATTEN, APPEND, and LISTP, to:

        T.

Case 1. (IMPLIES
	 (AND
	  (NOT (OR (NLISTP X) (NLISTP (CAR X))))
	  (EQUAL
	       (FLATTEN (CDR (GOPHER (CONS (CAAR X)
					   (CONS (CDAR X) (CDR X))))))
	       (CDR (FLATTEN (CONS (CAAR X)
				   (CONS (CDAR X) (CDR X))))))
	  (LISTP X))
	 (EQUAL (FLATTEN (CDR (GOPHER X)))
		(CDR (FLATTEN X)))).

  This simplifies, applying CDR-CONS, CAR-CONS, and
  ASSOCIATIVITY-OF-APPEND, and unfolding the definitions of NLISTP,
  OR, FLATTEN, and GOPHER, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.90102538 0.29596354 ]

GOPHER-RETURNS-CORRECT-STATE 


(PROVE-LEMMA CORRECTNESS-OF-SAMEFRINGE
	     (REWRITE)
	     (EQUAL (SAMEFRINGE X Y)
		    (EQUAL (FLATTEN X) (FLATTEN Y))))
This formula simplifies, clearly, to the following two new formulas:

Case 2. (IMPLIES (NOT (EQUAL (FLATTEN X) (FLATTEN Y)))
		 (NOT (SAMEFRINGE X Y))).

  Give the above formula the name *1.

Case 1. (IMPLIES (EQUAL (FLATTEN X) (FLATTEN Y))
		 (EQUAL (SAMEFRINGE X Y) T)),

  which we again simplify, clearly, to:

        (IMPLIES (EQUAL (FLATTEN X) (FLATTEN Y))
		 (SAMEFRINGE X Y)),

  which we would usually push and work on later by induction.  But if
  we must use induction to prove the input conjecture, we prefer to
  induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us consider:

(EQUAL (SAMEFRINGE X Y)
       (EQUAL (FLATTEN X) (FLATTEN Y))).

We named this *1.  We will appeal to induction.  Four inductions are
suggested by terms in the conjecture.  They merge into three likely
candidate inductions, all of which are unflawed.  So we will choose
the one suggested by the largest number of nonprimitive recursive
functions.  We will induct according to the following scheme:
      (AND (IMPLIES (OR (NLISTP X) (NLISTP Y))
		    (P X Y))
	   (IMPLIES (AND (NOT (OR (NLISTP X) (NLISTP Y)))
			 (P (CDR (GOPHER X)) (CDR (GOPHER Y))))
		    (P X Y))).
Linear arithmetic, the lemmas CDR-LESSEQP, GOPHER-PRESERVES-COUNT,
LISTP-GOPHER, and CDR-LESSP, and the definitions of OR and NLISTP
inform us that the measure (COUNT X) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
Note, however, the inductive instance chosen for Y.  The above
induction scheme generates two new conjectures:

Case 2. (IMPLIES (OR (NLISTP X) (NLISTP Y))
		 (EQUAL (SAMEFRINGE X Y)
			(EQUAL (FLATTEN X) (FLATTEN Y)))),

  which simplifies, rewriting with CAR-CONS and FLATTEN-SINGLETON,
  and opening up NLISTP, OR, SAMEFRINGE, and FLATTEN, to two new
  goals:

  Case 2.2.
          (IMPLIES (AND (NOT (LISTP X)) (EQUAL X Y))
		   (EQUAL (EQUAL X Y) T)).

    But this simplifies again, expanding EQUAL, to:

          T.

  Case 2.1.
          (IMPLIES (AND (NOT (LISTP X)) (EQUAL X Y))
		   (NOT (LISTP Y))),

    which we again simplify, trivially, to:

          T.

Case 1. (IMPLIES (AND (NOT (OR (NLISTP X) (NLISTP Y)))
		      (EQUAL (SAMEFRINGE (CDR (GOPHER X))
					 (CDR (GOPHER Y)))
			     (EQUAL (FLATTEN (CDR (GOPHER X)))
				    (FLATTEN (CDR (GOPHER Y))))))
		 (EQUAL (SAMEFRINGE X Y)
			(EQUAL (FLATTEN X) (FLATTEN Y)))),

  which we simplify, applying GOPHER-RETURNS-CORRECT-STATE and
  GOPHER-RETURNS-LEFTMOST-ATOM, and expanding the definitions of
  NLISTP, OR, and SAMEFRINGE, to three new formulas:

  Case 1.3.
          (IMPLIES (AND (LISTP X)
			(LISTP Y)
			(NOT (EQUAL (CDR (FLATTEN X))
				    (CDR (FLATTEN Y))))
			(NOT (SAMEFRINGE (CDR (GOPHER X))
					 (CDR (GOPHER Y)))))
		   (NOT (EQUAL (FLATTEN X) (FLATTEN Y)))),

    which again simplifies, clearly, to:

          T.

  Case 1.2.
          (IMPLIES (AND (LISTP X)
			(LISTP Y)
			(EQUAL (CDR (FLATTEN X))
			       (CDR (FLATTEN Y)))
			(EQUAL (SAMEFRINGE (CDR (GOPHER X))
					   (CDR (GOPHER Y)))
			       T)
			(NOT (EQUAL (FLATTEN X) (FLATTEN Y))))
		   (NOT (EQUAL (CAR (FLATTEN X))
			       (CAR (FLATTEN Y))))).

    This simplifies again, clearly, to:

          T.

  Case 1.1.
          (IMPLIES (AND (LISTP X)
			(LISTP Y)
			(EQUAL (CDR (FLATTEN X))
			       (CDR (FLATTEN Y)))
			(EQUAL (SAMEFRINGE (CDR (GOPHER X))
					   (CDR (GOPHER Y)))
			       T)
			(EQUAL (FLATTEN X) (FLATTEN Y)))
		   (EQUAL (EQUAL (CAR (FLATTEN X))
				 (CAR (FLATTEN Y)))
			  T)).

    This again simplifies, trivially, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 3.04799804 0.45999349 ]

CORRECTNESS-OF-SAMEFRINGE 


(DEFN PRIME1
      (X Y)
      (IF (ZEROP Y)
	  F
	  (IF (EQUAL Y 1.)
	      T
	      (AND (NOT (DIVIDES Y X))
		   (PRIME1 X (SUB1 Y))))))
     Linear arithmetic, the lemma COUNT-NUMBERP, and the definition
of ZEROP can be used to prove that the measure (COUNT Y) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, PRIME1 is accepted under the principle of definition.  Observe
that (OR (FALSEP (PRIME1 X Y)) (TRUEP (PRIME1 X Y))) is a theorem.




[ 0.828971356 0.0560221355 ]

PRIME1 


(DEFN PRIME
      (X)
      (AND (NOT (ZEROP X))
	   (NOT (EQUAL X 1.))
	   (PRIME1 X (SUB1 X))))
     Note that (OR (FALSEP (PRIME X)) (TRUEP (PRIME X))) is a theorem.




[ 0.063997396 0.0109863281 ]

PRIME 


(DEFN GREATEST-FACTOR
      (X Y)
      (IF (OR (ZEROP Y) (EQUAL Y 1.))
	  X
	  (IF (DIVIDES Y X)
	      Y
	      (GREATEST-FACTOR X (SUB1 Y)))))
     Linear arithmetic, the lemma COUNT-NUMBERP, and the definitions
of DIVIDES, OR, and ZEROP establish that the measure (COUNT Y)
decreases according to the well-founded relation LESSP in each
recursive call.  Hence, GREATEST-FACTOR is accepted under the
definitional principle.  From the definition we can conclude that:
      (OR (NUMBERP (GREATEST-FACTOR X Y))
	  (EQUAL (GREATEST-FACTOR X Y) X))
is a theorem.




[ 1.28701171 0.0559895835 ]

GREATEST-FACTOR 


(PROVE-LEMMA GREATEST-FACTOR-LESSP
	     (REWRITE)
	     (IMPLIES (AND (LESSP Y X)
			   (NOT (PRIME1 X Y))
			   (NOT (ZEROP X))
			   (NOT (EQUAL (SUB1 X) 0.))
			   (NOT (ZEROP Y)))
		      (LESSP (GREATEST-FACTOR X Y) X)))
This formula can be simplified, using the abbreviations ZEROP, NOT,
AND, and IMPLIES, to:

      (IMPLIES (AND (LESSP Y X)
		    (NOT (PRIME1 X Y))
		    (NOT (EQUAL X 0))
		    (NUMBERP X)
		    (NOT (EQUAL (SUB1 X) 0))
		    (NOT (EQUAL Y 0))
		    (NUMBERP Y))
	       (LESSP (GREATEST-FACTOR X Y) X)).

Appealing to the lemma SUB1-ELIM, we now replace X by (ADD1 Z) to
eliminate (SUB1 X).  We rely upon the type restriction lemma noted
when SUB1 was introduced to restrict the new variable.  This produces
the new conjecture:

      (IMPLIES (AND (NUMBERP Z)
		    (LESSP Y (ADD1 Z))
		    (NOT (PRIME1 (ADD1 Z) Y))
		    (NOT (EQUAL (ADD1 Z) 0))
		    (NOT (EQUAL Z 0))
		    (NOT (EQUAL Y 0))
		    (NUMBERP Y))
	       (LESSP (GREATEST-FACTOR (ADD1 Z) Y)
		      (ADD1 Z))).

However this simplifies, applying the lemma SUB1-ADD1, and expanding
the definition of LESSP, to the formula:

      (IMPLIES (AND (NUMBERP Z)
		    (LESSP (SUB1 Y) Z)
		    (NOT (PRIME1 (ADD1 Z) Y))
		    (NOT (EQUAL Z 0))
		    (NOT (EQUAL Y 0))
		    (NUMBERP Y)
		    (NOT (EQUAL (GREATEST-FACTOR (ADD1 Z) Y)
				0)))
	       (LESSP (SUB1 (GREATEST-FACTOR (ADD1 Z) Y))
		      Z)).

Applying the lemma SUB1-ELIM, replace Y by (ADD1 V) to eliminate
(SUB1 Y).  We employ the type restriction lemma noted when SUB1 was
introduced to restrict the new variable.  This generates the new
conjecture:

      (IMPLIES (AND (NUMBERP V)
		    (NUMBERP Z)
		    (LESSP V Z)
		    (NOT (PRIME1 (ADD1 Z) (ADD1 V)))
		    (NOT (EQUAL Z 0))
		    (NOT (EQUAL (ADD1 V) 0))
		    (NOT (EQUAL (GREATEST-FACTOR (ADD1 Z) (ADD1 V))
				0)))
	       (LESSP (SUB1 (GREATEST-FACTOR (ADD1 Z) (ADD1 V)))
		      Z)),

which we further simplify, rewriting with SUB1-ADD1 and ADD1-EQUAL,
and opening up DIVIDES, NUMBERP, PRIME1, GREATEST-FACTOR, and EQUAL,
to:

      (IMPLIES (AND (NUMBERP V)
		    (NUMBERP Z)
		    (LESSP V Z)
		    (NOT (EQUAL V 0))
		    (NOT (PRIME1 (ADD1 Z) V))
		    (NOT (EQUAL Z 0))
		    (NOT (EQUAL (REMAINDER (ADD1 Z) (ADD1 V))
				0))
		    (NOT (EQUAL (GREATEST-FACTOR (ADD1 Z) V)
				0)))
	       (LESSP (SUB1 (GREATEST-FACTOR (ADD1 Z) V))
		      Z)),

which we would usually push and work on later by induction.  But if
we must use induction to prove the input conjecture, we prefer to
induct on the original formulation of the problem.  Thus we will
disregard all that we have previously done, give the name *1 to the
original input, and work on it.


     So now let us consider:

(IMPLIES (AND (LESSP Y X)
	      (NOT (PRIME1 X Y))
	      (NOT (ZEROP X))
	      (NOT (EQUAL (SUB1 X) 0))
	      (NOT (ZEROP Y)))
	 (LESSP (GREATEST-FACTOR X Y) X)),

named *1 above.  Let us appeal to the induction principle.  The
recursive terms in the conjecture suggest five inductions.  They
merge into two likely candidate inductions.  However, only one is
unflawed.  We will induct according to the following scheme:
      (AND (IMPLIES (ZEROP Y) (P X Y))
	   (IMPLIES (AND (NOT (ZEROP Y)) (EQUAL Y 1))
		    (P X Y))
	   (IMPLIES (AND (NOT (ZEROP Y))
			 (NOT (EQUAL Y 1))
			 (P X (SUB1 Y)))
		    (P X Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP can be used to show that the measure (COUNT Y) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme generates five new
conjectures:

Case 5. (IMPLIES (AND (EQUAL Y 1)
		      (LESSP Y X)
		      (NOT (PRIME1 X Y))
		      (NOT (ZEROP X))
		      (NOT (EQUAL (SUB1 X) 0))
		      (NOT (ZEROP Y)))
		 (LESSP (GREATEST-FACTOR X Y) X)).

  This simplifies, unfolding the definitions of SUB1, NUMBERP, EQUAL,
  LESSP, and PRIME1, to:

        T.

Case 4. (IMPLIES (AND (NOT (EQUAL Y 1))
		      ( LEQ X (SUB1 Y))
		      (LESSP Y X)
		      (NOT (PRIME1 X Y))
		      (NOT (ZEROP X))
		      (NOT (EQUAL (SUB1 X) 0))
		      (NOT (ZEROP Y)))
		 (LESSP (GREATEST-FACTOR X Y) X)),

  which we simplify, using linear arithmetic, to:

        (IMPLIES (AND (LESSP Y 1)
		      (NOT (EQUAL Y 1))
		      ( LEQ X (SUB1 Y))
		      (LESSP Y X)
		      (NOT (PRIME1 X Y))
		      (NOT (ZEROP X))
		      (NOT (EQUAL (SUB1 X) 0))
		      (NOT (ZEROP Y)))
		 (LESSP (GREATEST-FACTOR X Y) X)),

  which we again simplify, applying SUB1-NNUMBERP, and unfolding SUB1,
  NUMBERP, EQUAL, and LESSP, to:

        T.

Case 3. (IMPLIES (AND (NOT (EQUAL Y 1))
		      (PRIME1 X (SUB1 Y))
		      (LESSP Y X)
		      (NOT (PRIME1 X Y))
		      (NOT (ZEROP X))
		      (NOT (EQUAL (SUB1 X) 0))
		      (NOT (ZEROP Y)))
		 (LESSP (GREATEST-FACTOR X Y) X)),

  which simplifies, expanding the definitions of LESSP, EQUAL, PRIME1,
  ZEROP, DIVIDES, and GREATEST-FACTOR, to:

        T.

Case 2. (IMPLIES (AND (NOT (EQUAL Y 1))
		      (ZEROP (SUB1 Y))
		      (LESSP Y X)
		      (NOT (PRIME1 X Y))
		      (NOT (ZEROP X))
		      (NOT (EQUAL (SUB1 X) 0))
		      (NOT (ZEROP Y)))
		 (LESSP (GREATEST-FACTOR X Y) X)).

  This simplifies, expanding the definitions of ZEROP, LESSP, EQUAL,
  PRIME1, REMAINDER, DIFFERENCE, DIVIDES, and GREATEST-FACTOR, to the
  following two new conjectures:

  Case 2.2.
          (IMPLIES (AND (NOT (EQUAL Y 1))
			(EQUAL (SUB1 Y) 0)
			(NOT (EQUAL X 0))
			(NUMBERP X)
			(NOT (PRIME1 X (SUB1 Y)))
			(NOT (EQUAL (SUB1 X) 0))
			(NOT (EQUAL Y 0))
			(NUMBERP Y)
			(NOT (EQUAL (REMAINDER (SUB1 X) Y) 0)))
		   (LESSP (GREATEST-FACTOR X (SUB1 Y))
			  X)).

    But this again simplifies, using linear arithmetic, to:

          T.

  Case 2.1.
          (IMPLIES (AND (NOT (EQUAL Y 1))
			(EQUAL (SUB1 Y) 0)
			(NOT (EQUAL X 0))
			(NUMBERP X)
			(NOT (PRIME1 X (SUB1 Y)))
			(NOT (EQUAL (SUB1 X) 0))
			(NOT (EQUAL Y 0))
			(NUMBERP Y)
			(EQUAL (REMAINDER (SUB1 X) Y) 0))
		   (LESSP Y X)),

    which we again simplify, using linear arithmetic, to:

          T.

Case 1. (IMPLIES (AND (NOT (EQUAL Y 1))
		      (LESSP (GREATEST-FACTOR X (SUB1 Y)) X)
		      (LESSP Y X)
		      (NOT (PRIME1 X Y))
		      (NOT (ZEROP X))
		      (NOT (EQUAL (SUB1 X) 0))
		      (NOT (ZEROP Y)))
		 (LESSP (GREATEST-FACTOR X Y) X)).

  This simplifies, opening up the definitions of LESSP, EQUAL, PRIME1,
  ZEROP, DIVIDES, and GREATEST-FACTOR, to:

        (IMPLIES (AND (NOT (EQUAL Y 1))
		      (LESSP (GREATEST-FACTOR X (SUB1 Y)) X)
		      (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (LESSP (SUB1 Y) (SUB1 X))
		      (NOT (PRIME1 X (SUB1 Y)))
		      (NOT (EQUAL (SUB1 X) 0))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (EQUAL (REMAINDER X Y) 0))
		 (LESSP Y X)),

  which we again simplify, using linear arithmetic, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 23.227132 0.93087565 ]

GREATEST-FACTOR-LESSP 


(PROVE-LEMMA GREATEST-FACTOR-DIVIDES
	     (REWRITE)
	     (IMPLIES (AND (LESSP Y X)
			   (NOT (PRIME1 X Y))
			   (NOT (ZEROP X))
			   (NOT (EQUAL X 1.))
			   (NOT (ZEROP Y)))
		      (EQUAL (REMAINDER X (GREATEST-FACTOR X Y))
			     0.)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT,
AND, and IMPLIES, to the new conjecture:

      (IMPLIES (AND (LESSP Y X)
		    (NOT (PRIME1 X Y))
		    (NOT (EQUAL X 0))
		    (NUMBERP X)
		    (NOT (EQUAL X 1))
		    (NOT (EQUAL Y 0))
		    (NUMBERP Y))
	       (EQUAL (REMAINDER X (GREATEST-FACTOR X Y))
		      0)).

Call the above conjecture *1.


     We will appeal to induction.  There are five plausible
inductions.  They merge into three likely candidate inductions.
However, only one is unflawed.  We will induct according to the
following scheme:
      (AND (IMPLIES (ZEROP Y) (P X Y))
	   (IMPLIES (AND (NOT (ZEROP Y)) (EQUAL Y 1))
		    (P X Y))
	   (IMPLIES (AND (NOT (ZEROP Y))
			 (NOT (EQUAL Y 1))
			 (P X (SUB1 Y)))
		    (P X Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP establish that the measure (COUNT Y) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme leads to the following six new conjectures:

Case 6. (IMPLIES (AND (ZEROP Y)
		      (LESSP Y X)
		      (NOT (PRIME1 X Y))
		      (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL X 1))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y))
		 (EQUAL (REMAINDER X (GREATEST-FACTOR X Y))
			0)).

  This simplifies, expanding the definition of ZEROP, to:

        T.

Case 5. (IMPLIES (AND (NOT (ZEROP Y))
		      (EQUAL Y 1)
		      (LESSP Y X)
		      (NOT (PRIME1 X Y))
		      (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL X 1))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y))
		 (EQUAL (REMAINDER X (GREATEST-FACTOR X Y))
			0)),

  which simplifies, unfolding the functions ZEROP, NUMBERP, EQUAL,
  and PRIME1, to:

        T.

Case 4. (IMPLIES (AND (NOT (ZEROP Y))
		      (NOT (EQUAL Y 1))
		      ( LEQ X (SUB1 Y))
		      (LESSP Y X)
		      (NOT (PRIME1 X Y))
		      (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL X 1))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y))
		 (EQUAL (REMAINDER X (GREATEST-FACTOR X Y))
			0)).

  This simplifies, using linear arithmetic, to:

        T.

Case 3. (IMPLIES (AND (NOT (ZEROP Y))
		      (NOT (EQUAL Y 1))
		      (PRIME1 X (SUB1 Y))
		      (LESSP Y X)
		      (NOT (PRIME1 X Y))
		      (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL X 1))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y))
		 (EQUAL (REMAINDER X (GREATEST-FACTOR X Y))
			0)).

  This simplifies, opening up ZEROP, PRIME1, DIVIDES, GREATEST-FACTOR,
  and EQUAL, to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP Y))
		      (NOT (EQUAL Y 1))
		      (EQUAL (SUB1 Y) 0)
		      (LESSP Y X)
		      (NOT (PRIME1 X Y))
		      (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL X 1))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y))
		 (EQUAL (REMAINDER X (GREATEST-FACTOR X Y))
			0)).

  This simplifies, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP Y))
		      (NOT (EQUAL Y 1))
		      (EQUAL (REMAINDER X
					(GREATEST-FACTOR X (SUB1 Y)))
			     0)
		      (LESSP Y X)
		      (NOT (PRIME1 X Y))
		      (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL X 1))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y))
		 (EQUAL (REMAINDER X (GREATEST-FACTOR X Y))
			0)),

  which we simplify, opening up ZEROP, PRIME1, DIVIDES,
  GREATEST-FACTOR, and EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 5.13500977 0.404003907 ]

GREATEST-FACTOR-DIVIDES 


(PROVE-LEMMA GREATEST-FACTOR-0
	     (REWRITE)
	     (EQUAL (EQUAL (GREATEST-FACTOR X Y) 0.)
		    (AND (OR (ZEROP Y) (EQUAL Y 1.))
			 (EQUAL X 0.))))
This formula simplifies, opening up the definitions of ZEROP, OR, and
AND, to the following seven new formulas:

Case 7. (IMPLIES (AND (EQUAL (GREATEST-FACTOR X Y) 0)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y))
		 (EQUAL Y 1)).

  Give the above formula the name *1.

Case 6. (IMPLIES (AND (NOT (EQUAL (GREATEST-FACTOR X Y) 0))
		      (EQUAL Y 0))
		 (NOT (EQUAL X 0))),

  which we again simplify, expanding GREATEST-FACTOR and EQUAL, to:

        T.

Case 5. (IMPLIES (AND (NOT (EQUAL (GREATEST-FACTOR X Y) 0))
		      (NOT (NUMBERP Y)))
		 (NOT (EQUAL X 0))).

  But this simplifies again, unfolding GREATEST-FACTOR and EQUAL, to:

        T.

Case 4. (IMPLIES (AND (NOT (EQUAL (GREATEST-FACTOR X Y) 0))
		      (EQUAL Y 1))
		 (NOT (EQUAL X 0))),

  which again simplifies, expanding the definitions of
  GREATEST-FACTOR and EQUAL, to:

        T.

Case 3. (IMPLIES (AND (EQUAL (GREATEST-FACTOR X Y) 0)
		      (EQUAL Y 0))
		 (EQUAL (EQUAL X 0) T)),

  which we again simplify, unfolding EQUAL and GREATEST-FACTOR, to:

        T.

Case 2. (IMPLIES (AND (EQUAL (GREATEST-FACTOR X Y) 0)
		      (NOT (NUMBERP Y)))
		 (EQUAL (EQUAL X 0) T)),

  which again simplifies, unfolding the function GREATEST-FACTOR, to:

        T.

Case 1. (IMPLIES (AND (EQUAL (GREATEST-FACTOR X Y) 0)
		      (EQUAL Y 1))
		 (EQUAL (EQUAL X 0) T)).

  But this simplifies again, expanding NUMBERP, EQUAL, and
  GREATEST-FACTOR, to:

        T.


     So let us turn our attention to:

      (IMPLIES (AND (EQUAL (GREATEST-FACTOR X Y) 0)
		    (NOT (EQUAL Y 0))
		    (NUMBERP Y))
	       (EQUAL Y 1)),

which is formula *1 above.  Let us appeal to the induction principle.
There is only one plausible induction.  We will induct according to
the following scheme:
      (AND (IMPLIES (OR (ZEROP Y) (EQUAL Y 1))
		    (P Y X))
	   (IMPLIES (AND (NOT (OR (ZEROP Y) (EQUAL Y 1)))
			 (DIVIDES Y X))
		    (P Y X))
	   (IMPLIES (AND (NOT (OR (ZEROP Y) (EQUAL Y 1)))
			 (NOT (DIVIDES Y X))
			 (P (SUB1 Y) X))
		    (P Y X))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definitions of
DIVIDES, OR, and ZEROP establish that the measure (COUNT Y) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme generates five new
conjectures:

Case 5. (IMPLIES (AND (OR (ZEROP Y) (EQUAL Y 1))
		      (EQUAL (GREATEST-FACTOR X Y) 0)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y))
		 (EQUAL Y 1)),

  which we simplify, unfolding ZEROP and OR, to:

        T.

Case 4. (IMPLIES (AND (NOT (OR (ZEROP Y) (EQUAL Y 1)))
		      (DIVIDES Y X)
		      (EQUAL (GREATEST-FACTOR X Y) 0)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y))
		 (EQUAL Y 1)),

  which simplifies, unfolding the definitions of ZEROP, OR, DIVIDES,
  GREATEST-FACTOR, and EQUAL, to:

        T.

Case 3. (IMPLIES (AND (NOT (OR (ZEROP Y) (EQUAL Y 1)))
		      (NOT (DIVIDES Y X))
		      (NOT (EQUAL (GREATEST-FACTOR X (SUB1 Y))
				  0))
		      (EQUAL (GREATEST-FACTOR X Y) 0)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y))
		 (EQUAL Y 1)).

  This simplifies, unfolding the definitions of ZEROP, OR, DIVIDES,
  and GREATEST-FACTOR, to:

        T.

Case 2. (IMPLIES (AND (NOT (OR (ZEROP Y) (EQUAL Y 1)))
		      (NOT (DIVIDES Y X))
		      (EQUAL (SUB1 Y) 0)
		      (EQUAL (GREATEST-FACTOR X Y) 0)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y))
		 (EQUAL Y 1)),

  which we simplify, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (AND (NOT (OR (ZEROP Y) (EQUAL Y 1)))
		      (NOT (DIVIDES Y X))
		      (EQUAL (SUB1 Y) 1)
		      (EQUAL (GREATEST-FACTOR X Y) 0)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y))
		 (EQUAL Y 1)).

  This simplifies, opening up the definitions of ZEROP, OR, DIVIDES,
  and GREATEST-FACTOR, to:

        (IMPLIES (AND (NOT (EQUAL (REMAINDER X Y) 0))
		      (EQUAL (SUB1 Y) 1)
		      (EQUAL (GREATEST-FACTOR X (SUB1 Y))
			     0)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y))
		 (EQUAL Y 1)),

  which we again simplify, unfolding the definitions of NUMBERP,
  EQUAL, and GREATEST-FACTOR, to:

        (IMPLIES (AND (NOT (EQUAL (REMAINDER X Y) 0))
		      (EQUAL (SUB1 Y) 1)
		      (EQUAL X 0)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y))
		 (EQUAL Y 1)).

  However this again simplifies, expanding the functions NUMBERP,
  LESSP, EQUAL, and REMAINDER, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 5.3859863 0.5480306 ]

GREATEST-FACTOR-0 


(PROVE-LEMMA REMAINDER-0-CROCK
	     (REWRITE)
	     (EQUAL (REMAINDER 0. Y) 0.)
	     NIL)
This simplifies, opening up the definitions of LESSP, EQUAL, NUMBERP,
and REMAINDER, to:

      T.

Q.E.D.


[ 0.08499349 0.0190104167 ]

REMAINDER-0-CROCK 


(PROVE-LEMMA GREATEST-FACTOR-1
	     (REWRITE)
	     (EQUAL (EQUAL (GREATEST-FACTOR X Y) 1.)
		    (EQUAL X 1.)))
This formula simplifies, trivially, to the following two new goals:

Case 2. (IMPLIES (NOT (EQUAL X 1))
		 (NOT (EQUAL (GREATEST-FACTOR X Y) 1))),

  which we will name *1.

Case 1. (IMPLIES (EQUAL X 1)
		 (EQUAL (EQUAL (GREATEST-FACTOR X Y) 1)
			T)).

  Of course, this simplifies again, clearly, to:

        (EQUAL (GREATEST-FACTOR 1 Y) 1),

  which we would normally push and work on later by induction.  But
  if we must use induction to prove the input conjecture, we prefer
  to induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us return to:

(EQUAL (EQUAL (GREATEST-FACTOR X Y) 1)
       (EQUAL X 1)),

named *1 above.  We will appeal to induction.  There is only one
suggested induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (OR (ZEROP Y) (EQUAL Y 1))
		    (P X Y))
	   (IMPLIES (AND (NOT (OR (ZEROP Y) (EQUAL Y 1)))
			 (DIVIDES Y X))
		    (P X Y))
	   (IMPLIES (AND (NOT (OR (ZEROP Y) (EQUAL Y 1)))
			 (NOT (DIVIDES Y X))
			 (P X (SUB1 Y)))
		    (P X Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definitions of
DIVIDES, OR, and ZEROP establish that the measure (COUNT Y) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme produces three new
conjectures:

Case 3. (IMPLIES (OR (ZEROP Y) (EQUAL Y 1))
		 (EQUAL (EQUAL (GREATEST-FACTOR X Y) 1)
			(EQUAL X 1))),

  which we simplify, unfolding ZEROP, OR, EQUAL, GREATEST-FACTOR, and
  NUMBERP, to:

        T.

Case 2. (IMPLIES (AND (NOT (OR (ZEROP Y) (EQUAL Y 1)))
		      (DIVIDES Y X))
		 (EQUAL (EQUAL (GREATEST-FACTOR X Y) 1)
			(EQUAL X 1))),

  which simplifies, unfolding the functions ZEROP, OR, DIVIDES,
  GREATEST-FACTOR, and EQUAL, to the formula:

        (IMPLIES (AND (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1))
		      (EQUAL (REMAINDER X Y) 0))
		 (NOT (EQUAL X 1))).

  However this simplifies again, using linear arithmetic, rewriting
  with REMAINDER-0-CROCK and DIFFERENCE-0, and opening up NUMBERP and
  REMAINDER, to:

        (IMPLIES (AND (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1)))
		 (LESSP 1 Y)).

  This simplifies again, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (AND (NOT (OR (ZEROP Y) (EQUAL Y 1)))
		      (NOT (DIVIDES Y X))
		      (EQUAL (EQUAL (GREATEST-FACTOR X (SUB1 Y))
				    1)
			     (EQUAL X 1)))
		 (EQUAL (EQUAL (GREATEST-FACTOR X Y) 1)
			(EQUAL X 1))),

  which we simplify, rewriting with REMAINDER-0-CROCK and
  DIFFERENCE-0, and unfolding the definitions of ZEROP, OR, DIVIDES,
  GREATEST-FACTOR, EQUAL, DIFFERENCE, SUB1, LESSP, NUMBERP, and
  REMAINDER, to the following two new formulas:

  Case 1.2.
          (IMPLIES (AND (NOT (EQUAL Y 0))
			(NUMBERP Y)
			(NOT (EQUAL Y 1))
			(NOT (EQUAL (REMAINDER X Y) 0))
			(EQUAL X 1)
			(EQUAL (EQUAL (GREATEST-FACTOR X (SUB1 Y))
				      1)
			       T))
		   (EQUAL (GREATEST-FACTOR 1 (SUB1 Y))
			  1)),

    which again simplifies, trivially, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NOT (EQUAL Y 0))
			(NUMBERP Y)
			(NOT (EQUAL Y 1))
			(NOT (EQUAL (REMAINDER X Y) 0))
			(EQUAL X 1)
			(EQUAL (EQUAL (GREATEST-FACTOR X (SUB1 Y))
				      1)
			       T))
		   (LESSP 1 Y)),

    which again simplifies, using linear arithmetic, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 4.5779622 0.480029296 ]

GREATEST-FACTOR-1 


(PROVE-LEMMA NUMBERP-GREATEST-FACTOR
	     (REWRITE)
	     (EQUAL (NUMBERP (GREATEST-FACTOR X Y))
		    (NOT (AND (OR (ZEROP Y) (EQUAL Y 1.))
			      (NOT (NUMBERP X))))))
This conjecture simplifies, opening up ZEROP, OR, NOT, and AND, to
the following five new goals:

Case 5. (IMPLIES (AND (EQUAL Y 0) (NOT (NUMBERP X)))
		 (EQUAL (NUMBERP (GREATEST-FACTOR X Y))
			F)),

  which we again simplify, expanding EQUAL and GREATEST-FACTOR, to:

        T.

Case 4. (IMPLIES (AND (NOT (NUMBERP Y))
		      (NOT (NUMBERP X)))
		 (EQUAL (NUMBERP (GREATEST-FACTOR X Y))
			F)).

  But this simplifies again, unfolding GREATEST-FACTOR and EQUAL, to:

        T.

Case 3. (IMPLIES (AND (EQUAL Y 1) (NOT (NUMBERP X)))
		 (EQUAL (NUMBERP (GREATEST-FACTOR X Y))
			F)),

  which again simplifies, expanding the definitions of NUMBERP, EQUAL,
  and GREATEST-FACTOR, to:

        T.

Case 2. (IMPLIES (AND (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1)))
		 (EQUAL (NUMBERP (GREATEST-FACTOR X Y))
			T)),

  which we again simplify, obviously, to:

        (IMPLIES (AND (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1)))
		 (NUMBERP (GREATEST-FACTOR X Y))),

  which we will name *1.

Case 1. (IMPLIES (NUMBERP X)
		 (EQUAL (NUMBERP (GREATEST-FACTOR X Y))
			T)).

  This again simplifies, trivially, to:

        T.


     So next consider:

      (IMPLIES (AND (NOT (EQUAL Y 0))
		    (NUMBERP Y)
		    (NOT (EQUAL Y 1)))
	       (NUMBERP (GREATEST-FACTOR X Y))),

which is formula *1 above.  Perhaps we can prove it by induction.
There is only one plausible induction.  We will induct according to
the following scheme:
      (AND (IMPLIES (OR (ZEROP Y) (EQUAL Y 1))
		    (P X Y))
	   (IMPLIES (AND (NOT (OR (ZEROP Y) (EQUAL Y 1)))
			 (DIVIDES Y X))
		    (P X Y))
	   (IMPLIES (AND (NOT (OR (ZEROP Y) (EQUAL Y 1)))
			 (NOT (DIVIDES Y X))
			 (P X (SUB1 Y)))
		    (P X Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definitions of
DIVIDES, OR, and ZEROP establish that the measure (COUNT Y) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme leads to five new formulas:

Case 5. (IMPLIES (AND (OR (ZEROP Y) (EQUAL Y 1))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1)))
		 (NUMBERP (GREATEST-FACTOR X Y))),

  which simplifies, expanding the definitions of ZEROP and OR, to:

        T.

Case 4. (IMPLIES (AND (NOT (OR (ZEROP Y) (EQUAL Y 1)))
		      (DIVIDES Y X)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1)))
		 (NUMBERP (GREATEST-FACTOR X Y))),

  which we simplify, unfolding ZEROP, OR, DIVIDES, GREATEST-FACTOR,
  and EQUAL, to:

        T.

Case 3. (IMPLIES (AND (NOT (OR (ZEROP Y) (EQUAL Y 1)))
		      (NOT (DIVIDES Y X))
		      (EQUAL (SUB1 Y) 0)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1)))
		 (NUMBERP (GREATEST-FACTOR X Y))),

  which simplifies, using linear arithmetic, to:

        T.

Case 2. (IMPLIES (AND (NOT (OR (ZEROP Y) (EQUAL Y 1)))
		      (NOT (DIVIDES Y X))
		      (EQUAL (SUB1 Y) 1)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1)))
		 (NUMBERP (GREATEST-FACTOR X Y))),

  which we simplify, expanding the functions ZEROP, OR, DIVIDES, and
  GREATEST-FACTOR, to:

        (IMPLIES (AND (NOT (EQUAL (REMAINDER X Y) 0))
		      (EQUAL (SUB1 Y) 1)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1)))
		 (NUMBERP (GREATEST-FACTOR X (SUB1 Y)))).

  But this simplifies again, unfolding the definitions of NUMBERP,
  EQUAL, and GREATEST-FACTOR, to the formula:

        (IMPLIES (AND (NOT (EQUAL (REMAINDER X Y) 0))
		      (EQUAL (SUB1 Y) 1)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1)))
		 (NUMBERP X)),

  which we again simplify, unfolding the definitions of LESSP,
  REMAINDER, and EQUAL, to:

        T.

Case 1. (IMPLIES (AND (NOT (OR (ZEROP Y) (EQUAL Y 1)))
		      (NOT (DIVIDES Y X))
		      (NUMBERP (GREATEST-FACTOR X (SUB1 Y)))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1)))
		 (NUMBERP (GREATEST-FACTOR X Y))),

  which simplifies, unfolding the definitions of ZEROP, OR, DIVIDES,
  and GREATEST-FACTOR, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 3.8719401 0.506054685 ]

NUMBERP-GREATEST-FACTOR 


(DEFN PRIME-FACTORS
 (X)
 (IF
  (OR (ZEROP X) (EQUAL (SUB1 X) 0.))
  NIL
  (IF
   (PRIME1 X (SUB1 X))
   (CONS X NIL)
   (APPEND (PRIME-FACTORS (GREATEST-FACTOR X (SUB1 X)))
	   (PRIME-FACTORS (QUOTIENT X
				    (GREATEST-FACTOR X (SUB1 X))))))))
     Linear arithmetic, the lemmas LESSP-QUOTIENT1, GREATEST-FACTOR-1,
GREATEST-FACTOR-0, COUNT-NUMBERP, and GREATEST-FACTOR-LESSP, and the
definitions of OR and ZEROP establish that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each
recursive call.  Hence, PRIME-FACTORS is accepted under the principle
of definition.  Observe that:
      (OR (LITATOM (PRIME-FACTORS X))
	  (LISTP (PRIME-FACTORS X)))
is a theorem.




[ 4.6420085 0.100976562 ]

PRIME-FACTORS 


(DEFN PRIME-LIST
      (L)
      (IF (NLISTP L)
	  T
	  (AND (PRIME (CAR L))
	       (PRIME-LIST (CDR L)))))
     Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT L) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, PRIME-LIST is accepted under the principle of definition.
Observe that (OR (FALSEP (PRIME-LIST L)) (TRUEP (PRIME-LIST L))) is a
theorem.




[ 0.35 0.0480143228 ]

PRIME-LIST 


(DEFN TIMES-LIST
      (L)
      (IF (NLISTP L)
	  1.
	  (TIMES (CAR L) (TIMES-LIST (CDR L)))))
     Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP establish that the measure (COUNT L) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, TIMES-LIST is accepted under the principle of definition.
Note that (NUMBERP (TIMES-LIST L)) is a theorem.




[ 0.77000325 0.044986979 ]

TIMES-LIST 


(PROVE-LEMMA TIMES-LIST-APPEND
	     (REWRITE)
	     (EQUAL (TIMES-LIST (APPEND X Y))
		    (TIMES (TIMES-LIST X)
			   (TIMES-LIST Y))))

     Give the conjecture the name *1.


     Let us appeal to the induction principle.  The recursive terms
in the conjecture suggest three inductions.  They merge into two
likely candidate inductions.  However, only one is unflawed.  We will
induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP X) (P (CDR X) Y))
		    (P X Y))
	   (IMPLIES (NOT (LISTP X)) (P X Y))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
generates two new conjectures:

Case 2. (IMPLIES (AND (LISTP X)
		      (EQUAL (TIMES-LIST (APPEND (CDR X) Y))
			     (TIMES (TIMES-LIST (CDR X))
				    (TIMES-LIST Y))))
		 (EQUAL (TIMES-LIST (APPEND X Y))
			(TIMES (TIMES-LIST X)
			       (TIMES-LIST Y)))),

  which simplifies, applying the lemmas COMMUTATIVITY-OF-TIMES,
  CDR-CONS, CAR-CONS, and ASSOCIATIVITY-OF-TIMES, and unfolding
  APPEND and TIMES-LIST, to:

        T.

Case 1. (IMPLIES (NOT (LISTP X))
		 (EQUAL (TIMES-LIST (APPEND X Y))
			(TIMES (TIMES-LIST X)
			       (TIMES-LIST Y)))),

  which simplifies, expanding the definitions of APPEND and
  TIMES-LIST, to:

        (IMPLIES (NOT (LISTP X))
		 (EQUAL (TIMES-LIST Y)
			(TIMES 1 (TIMES-LIST Y)))),

  which again simplifies, using linear arithmetic, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 2.6549479 0.25805664 ]

TIMES-LIST-APPEND 


(PROVE-LEMMA PRIME-LIST-APPEND
	     (REWRITE)
	     (EQUAL (PRIME-LIST (APPEND X Y))
		    (AND (PRIME-LIST X) (PRIME-LIST Y))))
This formula simplifies, unfolding AND, to the following two new
conjectures:

Case 2. (IMPLIES (NOT (PRIME-LIST X))
		 (EQUAL (PRIME-LIST (APPEND X Y)) F)),

  which again simplifies, obviously, to the new conjecture:

        (IMPLIES (NOT (PRIME-LIST X))
		 (NOT (PRIME-LIST (APPEND X Y)))).

  Call the above conjecture *1.

Case 1. (IMPLIES (PRIME-LIST X)
		 (EQUAL (PRIME-LIST (APPEND X Y))
			(PRIME-LIST Y))),

  which we would normally push and work on later by induction.  But
  if we must use induction to prove the input conjecture, we prefer
  to induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us return to:

(EQUAL (PRIME-LIST (APPEND X Y))
       (AND (PRIME-LIST X) (PRIME-LIST Y))).

We named this *1 above.  Let us appeal to the induction principle.
There are three plausible inductions.  They merge into two likely
candidate inductions.  However, only one is unflawed.  We will induct
according to the following scheme:
      (AND (IMPLIES (AND (LISTP X) (P (CDR X) Y))
		    (P X Y))
	   (IMPLIES (NOT (LISTP X)) (P X Y))).
Linear arithmetic and the lemma CDR-LESSP can be used to establish
that the measure (COUNT X) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme produces the following two new formulas:

Case 2. (IMPLIES (AND (LISTP X)
		      (EQUAL (PRIME-LIST (APPEND (CDR X) Y))
			     (AND (PRIME-LIST (CDR X))
				  (PRIME-LIST Y))))
		 (EQUAL (PRIME-LIST (APPEND X Y))
			(AND (PRIME-LIST X) (PRIME-LIST Y)))).

  This simplifies, rewriting with the lemmas CDR-CONS and CAR-CONS,
  and expanding AND, APPEND, PRIME, PRIME-LIST, and EQUAL, to:

        T.

Case 1. (IMPLIES (NOT (LISTP X))
		 (EQUAL (PRIME-LIST (APPEND X Y))
			(AND (PRIME-LIST X) (PRIME-LIST Y)))),

  which we simplify, opening up APPEND, PRIME-LIST, and AND, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 10.2580241 0.271972656 ]

PRIME-LIST-APPEND 


(PROVE-LEMMA PRIME-LIST-PRIME-FACTORS
	     (REWRITE)
	     (PRIME-LIST (PRIME-FACTORS X)))

     Give the conjecture the name *1.


     Let us appeal to the induction principle.  There is only one
suggested induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (OR (ZEROP X) (EQUAL (SUB1 X) 0))
		    (P X))
	   (IMPLIES (AND (NOT (OR (ZEROP X) (EQUAL (SUB1 X) 0)))
			 (PRIME1 X (SUB1 X)))
		    (P X))
	   (IMPLIES (AND (NOT (OR (ZEROP X) (EQUAL (SUB1 X) 0)))
			 (NOT (PRIME1 X (SUB1 X)))
			 (P (QUOTIENT X
				      (GREATEST-FACTOR X (SUB1 X))))
			 (P (GREATEST-FACTOR X (SUB1 X))))
		    (P X))).
Linear arithmetic, the lemmas LESSP-QUOTIENT1, GREATEST-FACTOR-1,
GREATEST-FACTOR-0, COUNT-NUMBERP, and GREATEST-FACTOR-LESSP, and the
definitions of OR and ZEROP inform us that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each
induction step of the scheme.  The above induction scheme generates
three new conjectures:

Case 3. (IMPLIES (OR (ZEROP X) (EQUAL (SUB1 X) 0))
		 (PRIME-LIST (PRIME-FACTORS X))),

  which simplifies, opening up the definitions of ZEROP, OR,
  PRIME-FACTORS, PRIME-LIST, and EQUAL, to:

        T.

Case 2. (IMPLIES (AND (NOT (OR (ZEROP X) (EQUAL (SUB1 X) 0)))
		      (PRIME1 X (SUB1 X)))
		 (PRIME-LIST (PRIME-FACTORS X))).

  This simplifies, applying CDR-CONS and CAR-CONS, and opening up the
  definitions of ZEROP, OR, PRIME-FACTORS, PRIME-LIST, and PRIME, to:

        (IMPLIES (AND (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL (SUB1 X) 0))
		      (PRIME1 X (SUB1 X)))
		 (NOT (EQUAL X 1))),

  which we again simplify, using linear arithmetic, to:

        T.

Case 1. (IMPLIES
	 (AND
	  (NOT (OR (ZEROP X) (EQUAL (SUB1 X) 0)))
	  (NOT (PRIME1 X (SUB1 X)))
	  (PRIME-LIST
	      (PRIME-FACTORS (QUOTIENT X
				       (GREATEST-FACTOR X (SUB1 X)))))
	  (PRIME-LIST (PRIME-FACTORS (GREATEST-FACTOR X (SUB1 X)))))
	 (PRIME-LIST (PRIME-FACTORS X))).

  This simplifies, rewriting with the lemma PRIME-LIST-APPEND, and
  unfolding the functions ZEROP, OR, and PRIME-FACTORS, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 7.12998044 0.262027994 ]

PRIME-LIST-PRIME-FACTORS 


(PROVE-LEMMA QUOTIENT-TIMES1
	     (REWRITE)
	     (IMPLIES (AND (NUMBERP Y)
			   (NUMBERP X)
			   (NOT (EQUAL X 0.))
			   (DIVIDES X Y))
		      (EQUAL (TIMES X (QUOTIENT Y X)) Y)))
This conjecture can be simplified, using the abbreviations NOT, AND,
IMPLIES, and DIVIDES, to:

      (IMPLIES (AND (NUMBERP Y)
		    (NUMBERP X)
		    (NOT (EQUAL X 0))
		    (EQUAL (REMAINDER Y X) 0))
	       (EQUAL (TIMES X (QUOTIENT Y X)) Y)).

Applying the lemma REMAINDER-QUOTIENT-ELIM, replace Y by
(PLUS Z (TIMES X V)) to eliminate (REMAINDER Y X) and (QUOTIENT Y X).
We employ LESSP-REMAINDER2, the type restriction lemma noted when
REMAINDER was introduced, and the type restriction lemma noted when
QUOTIENT was introduced to restrict the new variables.  We thus
obtain:

      (IMPLIES (AND (NUMBERP Z)
		    (EQUAL (LESSP Z X) (NOT (ZEROP X)))
		    (NUMBERP V)
		    (NUMBERP X)
		    (NOT (EQUAL X 0))
		    (EQUAL Z 0))
	       (EQUAL (TIMES X V)
		      (PLUS Z (TIMES X V)))).

However this simplifies, using linear arithmetic, to:

      T.

Q.E.D.


[ 1.51601562 0.106982422 ]

QUOTIENT-TIMES1 


(PROVE-LEMMA QUOTIENT-LESSP
	     (REWRITE)
	     (IMPLIES (AND (NOT (ZEROP X)) (LESSP X Y))
		      (NOT (EQUAL (QUOTIENT Y X) 0.))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT,
AND, and IMPLIES, to:

      (IMPLIES (AND (NOT (EQUAL X 0))
		    (NUMBERP X)
		    (LESSP X Y))
	       (NOT (EQUAL (QUOTIENT Y X) 0))).

Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace Y by
(PLUS V (TIMES X Z)) to eliminate (QUOTIENT Y X) and (REMAINDER Y X).
We rely upon LESSP-REMAINDER2, the type restriction lemma noted when
QUOTIENT was introduced, and the type restriction lemma noted when
REMAINDER was introduced to restrict the new variables.  We must thus
prove two new goals:

Case 2. (IMPLIES (AND (NOT (NUMBERP Y))
		      (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (LESSP X Y))
		 (NOT (EQUAL (QUOTIENT Y X) 0))),

  which we simplify, expanding the function LESSP, to:

        T.

Case 1. (IMPLIES (AND (NUMBERP Z)
		      (NUMBERP V)
		      (EQUAL (LESSP V X) (NOT (ZEROP X)))
		      (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (LESSP X (PLUS V (TIMES X Z))))
		 (NOT (EQUAL Z 0))).

  However this simplifies, rewriting with COMMUTATIVITY-OF-TIMES and
  COMMUTATIVITY-OF-PLUS, and unfolding the functions NUMBERP, ZEROP,
  NOT, EQUAL, TIMES, and PLUS, to the formula:

        (IMPLIES (AND (NUMBERP V)
		      (LESSP V X)
		      (NOT (EQUAL X 0))
		      (NUMBERP X))
		 ( LEQ V X)).

  However this simplifies again, using linear arithmetic, to:

        T.

Q.E.D.


[ 0.90600586 0.170996094 ]

QUOTIENT-LESSP 


(PROVE-LEMMA ENOUGH-FACTORS
	     (REWRITE)
	     (IMPLIES (NOT (ZEROP X))
		      (EQUAL (TIMES-LIST (PRIME-FACTORS X))
			     X)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT,
and IMPLIES, to the new formula:

      (IMPLIES (AND (NOT (EQUAL X 0)) (NUMBERP X))
	       (EQUAL (TIMES-LIST (PRIME-FACTORS X))
		      X)).

Name the above subgoal *1.


     We will try to prove it by induction.  There is only one
suggested induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (OR (ZEROP X) (EQUAL (SUB1 X) 0))
		    (P X))
	   (IMPLIES (AND (NOT (OR (ZEROP X) (EQUAL (SUB1 X) 0)))
			 (PRIME1 X (SUB1 X)))
		    (P X))
	   (IMPLIES (AND (NOT (OR (ZEROP X) (EQUAL (SUB1 X) 0)))
			 (NOT (PRIME1 X (SUB1 X)))
			 (P (QUOTIENT X
				      (GREATEST-FACTOR X (SUB1 X))))
			 (P (GREATEST-FACTOR X (SUB1 X))))
		    (P X))).
Linear arithmetic, the lemmas LESSP-QUOTIENT1, GREATEST-FACTOR-1,
GREATEST-FACTOR-0, COUNT-NUMBERP, and GREATEST-FACTOR-LESSP, and the
definitions of OR and ZEROP can be used to prove that the measure
(COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
produces eight new formulas:

Case 8. (IMPLIES (AND (OR (ZEROP X) (EQUAL (SUB1 X) 0))
		      (NOT (EQUAL X 0))
		      (NUMBERP X))
		 (EQUAL (TIMES-LIST (PRIME-FACTORS X))
			X)).

  This simplifies, opening up the definitions of ZEROP, OR,
  PRIME-FACTORS, EQUAL, and TIMES-LIST, to:

        (IMPLIES (AND (EQUAL (SUB1 X) 0)
		      (NOT (EQUAL X 0))
		      (NUMBERP X))
		 (EQUAL 1 X)),

  which we again simplify, using linear arithmetic, to:

        T.

Case 7. (IMPLIES (AND (NOT (OR (ZEROP X) (EQUAL (SUB1 X) 0)))
		      (PRIME1 X (SUB1 X))
		      (NOT (EQUAL X 0))
		      (NUMBERP X))
		 (EQUAL (TIMES-LIST (PRIME-FACTORS X))
			X)).

  This simplifies, rewriting with the lemmas COMMUTATIVITY-OF-TIMES,
  COMMUTATIVITY-OF-PLUS, CDR-CONS, and CAR-CONS, and unfolding the
  functions ZEROP, OR, PRIME-FACTORS, PLUS, TIMES, EQUAL, NUMBERP,
  SUB1, and TIMES-LIST, to:

        T.

Case 6. (IMPLIES (AND (NOT (OR (ZEROP X) (EQUAL (SUB1 X) 0)))
		      (NOT (PRIME1 X (SUB1 X)))
		      (EQUAL (QUOTIENT X
				       (GREATEST-FACTOR X (SUB1 X)))
			     0)
		      (EQUAL (GREATEST-FACTOR X (SUB1 X))
			     0)
		      (NOT (EQUAL X 0))
		      (NUMBERP X))
		 (EQUAL (TIMES-LIST (PRIME-FACTORS X))
			X)).

  This simplifies, rewriting with GREATEST-FACTOR-0, and expanding
  ZEROP, OR, EQUAL, and QUOTIENT, to:

        T.

Case 5. (IMPLIES
	 (AND
	  (NOT (OR (ZEROP X) (EQUAL (SUB1 X) 0)))
	  (NOT (PRIME1 X (SUB1 X)))
	  (EQUAL
	   (TIMES-LIST
	      (PRIME-FACTORS (QUOTIENT X
				       (GREATEST-FACTOR X (SUB1 X)))))
	   (QUOTIENT X
		     (GREATEST-FACTOR X (SUB1 X))))
	  (EQUAL (GREATEST-FACTOR X (SUB1 X))
		 0)
	  (NOT (EQUAL X 0))
	  (NUMBERP X))
	 (EQUAL (TIMES-LIST (PRIME-FACTORS X))
		X)),

  which we simplify, opening up ZEROP, OR, EQUAL, QUOTIENT,
  PRIME-FACTORS, and TIMES-LIST, to:

        T.

Case 4. (IMPLIES (AND (NOT (OR (ZEROP X) (EQUAL (SUB1 X) 0)))
		      (NOT (PRIME1 X (SUB1 X)))
		      (EQUAL (QUOTIENT X
				       (GREATEST-FACTOR X (SUB1 X)))
			     0)
		      (NOT (NUMBERP (GREATEST-FACTOR X (SUB1 X))))
		      (NOT (EQUAL X 0))
		      (NUMBERP X))
		 (EQUAL (TIMES-LIST (PRIME-FACTORS X))
			X)),

  which simplifies, expanding the definitions of ZEROP, OR, QUOTIENT,
  and EQUAL, to:

        T.

Case 3. (IMPLIES
	 (AND
	  (NOT (OR (ZEROP X) (EQUAL (SUB1 X) 0)))
	  (NOT (PRIME1 X (SUB1 X)))
	  (EQUAL
	   (TIMES-LIST
	      (PRIME-FACTORS (QUOTIENT X
				       (GREATEST-FACTOR X (SUB1 X)))))
	   (QUOTIENT X
		     (GREATEST-FACTOR X (SUB1 X))))
	  (NOT (NUMBERP (GREATEST-FACTOR X (SUB1 X))))
	  (NOT (EQUAL X 0))
	  (NUMBERP X))
	 (EQUAL (TIMES-LIST (PRIME-FACTORS X))
		X)),

  which we simplify, unfolding ZEROP, OR, and QUOTIENT, to:

        T.

Case 2. (IMPLIES
	 (AND
	  (NOT (OR (ZEROP X) (EQUAL (SUB1 X) 0)))
	  (NOT (PRIME1 X (SUB1 X)))
	  (EQUAL (QUOTIENT X
			   (GREATEST-FACTOR X (SUB1 X)))
		 0)
	  (EQUAL
	     (TIMES-LIST (PRIME-FACTORS (GREATEST-FACTOR X (SUB1 X))))
	     (GREATEST-FACTOR X (SUB1 X)))
	  (NOT (EQUAL X 0))
	  (NUMBERP X))
	 (EQUAL (TIMES-LIST (PRIME-FACTORS X))
		X)),

  which simplifies, using linear arithmetic, rewriting with
  GREATEST-FACTOR-LESSP, GREATEST-FACTOR-0, and QUOTIENT-LESSP, and
  expanding the definitions of ZEROP and OR, to:

        T.

Case 1. (IMPLIES
	 (AND
	  (NOT (OR (ZEROP X) (EQUAL (SUB1 X) 0)))
	  (NOT (PRIME1 X (SUB1 X)))
	  (EQUAL
	   (TIMES-LIST
	      (PRIME-FACTORS (QUOTIENT X
				       (GREATEST-FACTOR X (SUB1 X)))))
	   (QUOTIENT X
		     (GREATEST-FACTOR X (SUB1 X))))
	  (EQUAL
	     (TIMES-LIST (PRIME-FACTORS (GREATEST-FACTOR X (SUB1 X))))
	     (GREATEST-FACTOR X (SUB1 X)))
	  (NOT (EQUAL X 0))
	  (NUMBERP X))
	 (EQUAL (TIMES-LIST (PRIME-FACTORS X))
		X)).

  This simplifies, applying TIMES-LIST-APPEND, and opening up ZEROP,
  OR, and PRIME-FACTORS, to:

        (IMPLIES
	 (AND
	  (NOT (EQUAL (SUB1 X) 0))
	  (NOT (PRIME1 X (SUB1 X)))
	  (EQUAL
	   (TIMES-LIST
	      (PRIME-FACTORS (QUOTIENT X
				       (GREATEST-FACTOR X (SUB1 X)))))
	   (QUOTIENT X
		     (GREATEST-FACTOR X (SUB1 X))))
	  (EQUAL
	     (TIMES-LIST (PRIME-FACTORS (GREATEST-FACTOR X (SUB1 X))))
	     (GREATEST-FACTOR X (SUB1 X)))
	  (NOT (EQUAL X 0))
	  (NUMBERP X))
	 (EQUAL (TIMES (GREATEST-FACTOR X (SUB1 X))
		       (QUOTIENT X
				 (GREATEST-FACTOR X (SUB1 X))))
		X)),

  which we again simplify, using linear arithmetic, applying
  GREATEST-FACTOR-DIVIDES, GREATEST-FACTOR-0, and QUOTIENT-TIMES1,
  and unfolding DIVIDES and EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 32.81403 0.611979164 ]

ENOUGH-FACTORS 


(PROVE-LEMMA PRIME-FACTORIZATION-EXISTENCE NIL
	     (IMPLIES (NOT (ZEROP X))
		      (AND (EQUAL (TIMES-LIST (PRIME-FACTORS X))
				  X)
			   (PRIME-LIST (PRIME-FACTORS X)))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT,
and IMPLIES, to:

      (IMPLIES (AND (NOT (EQUAL X 0)) (NUMBERP X))
	       (AND (EQUAL (TIMES-LIST (PRIME-FACTORS X))
			   X)
		    (PRIME-LIST (PRIME-FACTORS X)))).

This simplifies, applying ENOUGH-FACTORS and PRIME-LIST-PRIME-FACTORS,
and unfolding AND, to:

      T.

Q.E.D.


[ 3.919987 0.0450032554 ]

PRIME-FACTORIZATION-EXISTENCE 


(DEFN GREATEREQPR
      (W Z)
      (IF (ZEROP W)
	  (ZEROP Z)
	  (IF (EQUAL W Z)
	      T
	      (GREATEREQPR (SUB1 W) Z))))
     Linear arithmetic, the lemma COUNT-NUMBERP, and the definition
of ZEROP can be used to establish that the measure (COUNT W)
decreases according to the well-founded relation LESSP in each
recursive call.  Hence, GREATEREQPR is accepted under the
definitional principle.  Observe that:
      (OR (FALSEP (GREATEREQPR W Z))
	  (TRUEP (GREATEREQPR W Z)))
is a theorem.




[ 1.07299805 0.052001953 ]

GREATEREQPR 


(PROVE-LEMMA TIMES-ID-IFF-1
	     (REWRITE)
	     (EQUAL (EQUAL Z (TIMES W Z))
		    (AND (NUMBERP Z)
			 (OR (EQUAL Z 0.) (EQUAL W 1.)))))
This formula simplifies, opening up the definitions of OR and AND, to
the following four new formulas:

Case 4. (IMPLIES (AND (EQUAL Z (TIMES W Z))
		      (NOT (EQUAL Z 0)))
		 (EQUAL (EQUAL W 1) T)).

  Of course, this simplifies again, clearly, to:

        (IMPLIES (AND (EQUAL Z (TIMES W Z))
		      (NOT (EQUAL Z 0)))
		 (EQUAL W 1)).

  We now use the above equality hypothesis by substituting
  (TIMES W Z) for Z and keeping the equality hypothesis.  This
  generates the new formula:

        (IMPLIES (AND (EQUAL Z (TIMES W Z))
		      (NOT (EQUAL (TIMES W Z) 0)))
		 (EQUAL W 1)).

  This further simplifies, clearly, to:

        (IMPLIES (AND (EQUAL Z (TIMES W Z))
		      (NOT (EQUAL Z 0)))
		 (EQUAL W 1)),

  which we would normally push and work on later by induction.  But
  if we must use induction to prove the input conjecture, we prefer
  to induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us consider:

(EQUAL (EQUAL Z (TIMES W Z))
       (AND (NUMBERP Z)
	    (OR (EQUAL Z 0) (EQUAL W 1)))),

which we named *1 above.  We will try to prove it by induction.
There is only one suggested induction.  We will induct according to
the following scheme:
      (AND (IMPLIES (ZEROP W) (P Z W))
	   (IMPLIES (AND (NOT (ZEROP W)) (P Z (SUB1 W)))
		    (P Z W))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP can be used to prove that the measure (COUNT W) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme produces the following two
new formulas:

Case 2. (IMPLIES (ZEROP W)
		 (EQUAL (EQUAL Z (TIMES W Z))
			(AND (NUMBERP Z)
			     (OR (EQUAL Z 0) (EQUAL W 1))))).

  This simplifies, expanding ZEROP, EQUAL, TIMES, OR, and AND, to
  four new formulas:

  Case 2.4.
          (IMPLIES (AND (EQUAL W 0) (EQUAL Z 0))
		   (EQUAL (EQUAL Z 0) T)),

    which again simplifies, expanding the definition of EQUAL, to:

          T.

  Case 2.3.
          (IMPLIES (AND (EQUAL W 0) (EQUAL Z 0))
		   (NUMBERP Z)),

    which we again simplify, obviously, to:

          T.

  Case 2.2.
          (IMPLIES (AND (NOT (NUMBERP W)) (EQUAL Z 0))
		   (EQUAL (EQUAL Z 0) T)).

    This again simplifies, unfolding the definition of EQUAL, to:

          T.

  Case 2.1.
          (IMPLIES (AND (NOT (NUMBERP W)) (EQUAL Z 0))
		   (NUMBERP Z)).

    Of course, this simplifies again, clearly, to:

          T.

Case 1. (IMPLIES (AND (NOT (ZEROP W))
		      (EQUAL (EQUAL Z (TIMES (SUB1 W) Z))
			     (AND (NUMBERP Z)
				  (OR (EQUAL Z 0)
				      (EQUAL (SUB1 W) 1)))))
		 (EQUAL (EQUAL Z (TIMES W Z))
			(AND (NUMBERP Z)
			     (OR (EQUAL Z 0) (EQUAL W 1))))),

  which we simplify, rewriting with CORRECTNESS-OF-CANCEL,
  EQUAL-TIMES-0, TIMES-ZERO2, and COMMUTATIVITY-OF-TIMES, and
  expanding the functions ZEROP, OR, AND, TIMES, FIX, EQUAL, and
  NUMBERP, to the following four new formulas:

  Case 1.4.
          (IMPLIES (AND (NOT (EQUAL W 0))
			(NUMBERP W)
			(EQUAL Z (TIMES (SUB1 W) Z))
			(NUMBERP Z)
			(EQUAL (EQUAL (SUB1 W) 1) T)
			(NOT (EQUAL 0 Z)))
		   (NOT (EQUAL Z 0))),

    which we again simplify, obviously, to:

          T.

  Case 1.3.
          (IMPLIES (AND (NOT (EQUAL W 0))
			(NUMBERP W)
			(EQUAL Z (TIMES (SUB1 W) Z))
			(NUMBERP Z)
			(EQUAL (EQUAL (SUB1 W) 1) T)
			(NOT (EQUAL 0 Z)))
		   (NOT (EQUAL W 1))),

    which we again simplify, opening up EQUAL, NUMBERP, SUB1, and
    TIMES, to:

          T.

  Case 1.2.
          (IMPLIES (AND (NOT (EQUAL W 0))
			(NUMBERP W)
			(EQUAL Z (TIMES (SUB1 W) Z))
			(NUMBERP Z)
			(EQUAL (EQUAL (SUB1 W) 1) T)
			(EQUAL 0 Z)
			(NOT (EQUAL Z 0)))
		   (EQUAL (EQUAL W 1) T)).

    This again simplifies, clearly, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NOT (EQUAL W 0))
			(NUMBERP W)
			(NOT (EQUAL Z (TIMES (SUB1 W) Z)))
			(NOT (EQUAL Z 0))
			(NOT (EQUAL (SUB1 W) 1))
			(NUMBERP Z))
		   (EQUAL (EQUAL 0 (SUB1 W))
			  (EQUAL W 1))).

    This again simplifies, clearly, to two new goals:

    Case 1.1.2.
            (IMPLIES (AND (NOT (EQUAL W 0))
			  (NUMBERP W)
			  (NOT (EQUAL Z (TIMES (SUB1 W) Z)))
			  (NOT (EQUAL Z 0))
			  (NOT (EQUAL (SUB1 W) 1))
			  (NUMBERP Z)
			  (NOT (EQUAL W 1)))
		     (NOT (EQUAL 0 (SUB1 W)))).

      But this simplifies again, using linear arithmetic, to:

            T.

    Case 1.1.1.
            (IMPLIES (AND (NOT (EQUAL W 0))
			  (NUMBERP W)
			  (NOT (EQUAL Z (TIMES (SUB1 W) Z)))
			  (NOT (EQUAL Z 0))
			  (NOT (EQUAL (SUB1 W) 1))
			  (NUMBERP Z)
			  (EQUAL W 1))
		     (EQUAL (EQUAL 0 (SUB1 W)) T)),

      which we again simplify, expanding the functions EQUAL, NUMBERP,
      SUB1, and TIMES, to:

            T.


     That finishes the proof of *1.  Q.E.D.


[ 3.37296548 0.7800293 ]

TIMES-ID-IFF-1 


(PROVE-LEMMA PRIME1-BASIC
	     (REWRITE)
	     (IMPLIES (AND (NOT (EQUAL Z 1.))
			   (NOT (EQUAL Z 0.))
			   (NUMBERP Z)
			   (GREATEREQPR U Z))
		      (NOT (PRIME1 (TIMES W Z) U))))

     Name the conjecture *1.


     Perhaps we can prove it by induction.  The recursive terms in
the conjecture suggest three inductions.  They merge into two likely
candidate inductions, both of which are unflawed.  However, one of
these is more likely than the other.  We will induct according to the
following scheme:
      (AND (IMPLIES (ZEROP U) (P W Z U))
	   (IMPLIES (AND (NOT (ZEROP U)) (EQUAL U Z))
		    (P W Z U))
	   (IMPLIES (AND (NOT (ZEROP U))
			 (NOT (EQUAL U Z))
			 (P W Z (SUB1 U)))
		    (P W Z U))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP inform us that the measure (COUNT U) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme produces four new formulas:

Case 4. (IMPLIES (AND (ZEROP U)
		      (NOT (EQUAL Z 1))
		      (NOT (EQUAL Z 0))
		      (NUMBERP Z)
		      (GREATEREQPR U Z))
		 (NOT (PRIME1 (TIMES W Z) U))).

  This simplifies, opening up the definitions of ZEROP, EQUAL, and
  GREATEREQPR, to:

        T.

Case 3. (IMPLIES (AND (NOT (ZEROP U))
		      (EQUAL U Z)
		      (NOT (EQUAL Z 1))
		      (NOT (EQUAL Z 0))
		      (NUMBERP Z)
		      (GREATEREQPR U Z))
		 (NOT (PRIME1 (TIMES W Z) U))),

  which we simplify, rewriting with the lemma DIVIDES-TIMES, and
  unfolding the functions ZEROP, GREATEREQPR, DIVIDES, EQUAL, and
  PRIME1, to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP U))
		      (NOT (EQUAL U Z))
		      (NOT (GREATEREQPR (SUB1 U) Z))
		      (NOT (EQUAL Z 1))
		      (NOT (EQUAL Z 0))
		      (NUMBERP Z)
		      (GREATEREQPR U Z))
		 (NOT (PRIME1 (TIMES W Z) U))).

  This simplifies, opening up the functions ZEROP and GREATEREQPR, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP U))
		      (NOT (EQUAL U Z))
		      (NOT (PRIME1 (TIMES W Z) (SUB1 U)))
		      (NOT (EQUAL Z 1))
		      (NOT (EQUAL Z 0))
		      (NUMBERP Z)
		      (GREATEREQPR U Z))
		 (NOT (PRIME1 (TIMES W Z) U))).

  This simplifies, expanding ZEROP, GREATEREQPR, PRIME1, and DIVIDES,
  to:

        (IMPLIES (AND (NOT (EQUAL U 0))
		      (NUMBERP U)
		      (NOT (EQUAL U Z))
		      (NOT (PRIME1 (TIMES W Z) (SUB1 U)))
		      (NOT (EQUAL Z 1))
		      (NOT (EQUAL Z 0))
		      (NUMBERP Z)
		      (GREATEREQPR (SUB1 U) Z))
		 (NOT (EQUAL U 1))),

  which we again simplify, unfolding the definitions of EQUAL,
  NUMBERP, SUB1, PRIME1, and GREATEREQPR, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 3.55900064 0.34498698 ]

PRIME1-BASIC 


(PROVE-LEMMA GREATEREQPR-LESSP
	     (REWRITE)
	     (EQUAL (GREATEREQPR X Y) ( LEQ Y X)))
This simplifies, opening up the function NOT, to the following two
new goals:

Case 2. (IMPLIES ( LEQ Y X)
		 (EQUAL (GREATEREQPR X Y) T)),

  which again simplifies, trivially, to:

        (IMPLIES ( LEQ Y X)
		 (GREATEREQPR X Y)),

  which we will name *1.

Case 1. (IMPLIES (LESSP X Y)
		 (EQUAL (GREATEREQPR X Y) F)).

  This again simplifies, trivially, to:

        (IMPLIES (LESSP X Y)
		 (NOT (GREATEREQPR X Y))),

  which we would usually push and work on later by induction.  But if
  we must use induction to prove the input conjecture, we prefer to
  induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us return to:

(EQUAL (GREATEREQPR X Y) ( LEQ Y X)).

We named this *1.  Let us appeal to the induction principle.  Three
inductions are suggested by terms in the conjecture.  They merge into
two likely candidate inductions.  However, only one is unflawed.  We
will induct according to the following scheme:
      (AND (IMPLIES (ZEROP X) (P X Y))
	   (IMPLIES (AND (NOT (ZEROP X)) (EQUAL X Y))
		    (P X Y))
	   (IMPLIES (AND (NOT (ZEROP X))
			 (NOT (EQUAL X Y))
			 (P (SUB1 X) Y))
		    (P X Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP establish that the measure (COUNT X) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme produces the following three new formulas:

Case 3. (IMPLIES (ZEROP X)
		 (EQUAL (GREATEREQPR X Y) ( LEQ Y X))),

  which simplifies, unfolding the functions ZEROP, EQUAL, GREATEREQPR,
  LESSP, and NOT, to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP X)) (EQUAL X Y))
		 (EQUAL (GREATEREQPR X Y) ( LEQ Y X))).

  This simplifies, unfolding the definitions of ZEROP, GREATEREQPR,
  and NOT, to:

        (IMPLIES (AND (NOT (EQUAL Y 0)) (NUMBERP Y))
		 ( LEQ Y Y)),

  which we again simplify, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP X))
		      (NOT (EQUAL X Y))
		      (EQUAL (GREATEREQPR (SUB1 X) Y)
			     ( LEQ Y (SUB1 X))))
		 (EQUAL (GREATEREQPR X Y) ( LEQ Y X))),

  which we simplify, expanding the definitions of ZEROP, NOT, and
  GREATEREQPR, to two new conjectures:

  Case 1.2.
          (IMPLIES (AND (NOT (EQUAL X 0))
			(NUMBERP X)
			(NOT (EQUAL X Y))
			( LEQ Y (SUB1 X))
			(EQUAL (GREATEREQPR (SUB1 X) Y) T))
		   ( LEQ Y X)),

    which we again simplify, using linear arithmetic, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NOT (EQUAL X 0))
			(NUMBERP X)
			(NOT (EQUAL X Y))
			(LESSP (SUB1 X) Y)
			(EQUAL (GREATEREQPR (SUB1 X) Y) F))
		   (LESSP X Y)),

    which again simplifies, using linear arithmetic, to:

          (IMPLIES (AND (NOT (NUMBERP Y))
			(NOT (EQUAL X 0))
			(NUMBERP X)
			(NOT (EQUAL X Y))
			(LESSP (SUB1 X) Y)
			(EQUAL (GREATEREQPR (SUB1 X) Y) F))
		   (LESSP X Y)).

    However this simplifies again, expanding the function LESSP, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 1.46206054 0.41993815 ]

GREATEREQPR-LESSP 


(PROVE-LEMMA GREATEREQPR-REMAINDER
	     (REWRITE)
	     (IMPLIES (AND (NOT (EQUAL Z (ADD1 V)))
			   (DIVIDES Z (ADD1 V)))
		      (GREATEREQPR V Z)))
This conjecture can be simplified, using the abbreviations
GREATEREQPR-LESSP, NOT, AND, IMPLIES, and DIVIDES, to:

      (IMPLIES (AND (NOT (EQUAL Z (ADD1 V)))
		    (EQUAL (REMAINDER (ADD1 V) Z) 0))
	       ( LEQ Z V)).

This simplifies, using linear arithmetic, applying REMAINDER-0-CROCK,
DIFFERENCE-0, and SUB1-ADD1, and unfolding LESSP, REMAINDER, and
EQUAL, to four new goals:

Case 4. (IMPLIES (AND (NOT (EQUAL Z (ADD1 V)))
		      (NUMBERP Z)
		      (NOT (EQUAL Z 0))
		      (NOT (NUMBERP V)))
		 (LESSP 0 (SUB1 Z))),

  which we again simplify, using linear arithmetic, to:

        (IMPLIES (AND (NOT (EQUAL 1 (ADD1 V)))
		      (NUMBERP 1)
		      (NOT (EQUAL 1 0))
		      (NOT (NUMBERP V)))
		 (LESSP 0 (SUB1 1))),

  which again simplifies, rewriting with SUB1-TYPE-RESTRICTION, and
  opening up EQUAL, to:

        T.

Case 3. (IMPLIES (AND (NOT (EQUAL Z (ADD1 V)))
		      (NUMBERP Z)
		      (NOT (EQUAL Z 0))
		      (NUMBERP V)
		      ( LEQ (SUB1 Z) V))
		 ( LEQ Z V)),

  which again simplifies, using linear arithmetic, to:

        T.

Case 2. (IMPLIES (AND (NOT (EQUAL Z (ADD1 V)))
		      (NUMBERP Z)
		      (NUMBERP V)
		      (LESSP V (SUB1 Z))
		      (EQUAL (ADD1 V) 0))
		 ( LEQ Z V)).

  But this simplifies again, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (AND (NOT (EQUAL Z (ADD1 V)))
		      (NUMBERP Z)
		      (NOT (NUMBERP V))
		      (LESSP 0 (SUB1 Z))
		      (EQUAL (ADD1 V) 0))
		 (EQUAL Z 0)).

  However this simplifies again, using linear arithmetic, to:

        T.

Q.E.D.


[ 0.67900391 0.199983723 ]

GREATEREQPR-REMAINDER 


(PROVE-LEMMA PRIME-BASIC
	     (REWRITE)
	     (IMPLIES (AND (NOT (EQUAL Z 1.))
			   (NOT (EQUAL Z X))
			   (NOT (ZEROP X))
			   (NOT (EQUAL X 1.))
			   (DIVIDES Z X))
		      (NOT (PRIME1 X (SUB1 X)))))

WARNING:  Note that PRIME-BASIC contains the free variable Z which
will be chosen by instantiating the hypothesis (NOT (EQUAL Z 1.)).

This formula can be simplified, using the abbreviations ZEROP, NOT,
AND, IMPLIES, and DIVIDES, to:

      (IMPLIES (AND (NOT (EQUAL Z 1))
		    (NOT (EQUAL Z X))
		    (NOT (EQUAL X 0))
		    (NUMBERP X)
		    (NOT (EQUAL X 1))
		    (EQUAL (REMAINDER X Z) 0))
	       (NOT (PRIME1 X (SUB1 X)))).

Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace X by
(PLUS V (TIMES Z W)) to eliminate (REMAINDER X Z) and (QUOTIENT X Z).
We rely upon LESSP-REMAINDER2, the type restriction lemma noted when
REMAINDER was introduced, and the type restriction lemma noted when
QUOTIENT was introduced to restrict the new variables.  This produces
the following three new goals:

Case 3. (IMPLIES (AND (EQUAL Z 0)
		      (NOT (EQUAL Z 1))
		      (NOT (EQUAL Z X))
		      (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL X 1))
		      (EQUAL (REMAINDER X Z) 0))
		 (NOT (PRIME1 X (SUB1 X)))),

  which simplifies, unfolding the definitions of EQUAL and REMAINDER,
  to:

        T.

Case 2. (IMPLIES (AND (NOT (NUMBERP Z))
		      (NOT (EQUAL Z 1))
		      (NOT (EQUAL Z X))
		      (NOT (EQUAL X 0))
		      (NUMBERP X)
		      (NOT (EQUAL X 1))
		      (EQUAL (REMAINDER X Z) 0))
		 (NOT (PRIME1 X (SUB1 X)))).

  This simplifies, applying REMAINDER-WRT-12, to:

        T.

Case 1. (IMPLIES (AND (NUMBERP V)
		      (EQUAL (LESSP V Z) (NOT (ZEROP Z)))
		      (NUMBERP W)
		      (NUMBERP Z)
		      (NOT (EQUAL Z 0))
		      (NOT (EQUAL Z 1))
		      (NOT (EQUAL Z (PLUS V (TIMES Z W))))
		      (NOT (EQUAL (PLUS V (TIMES Z W)) 0))
		      (NOT (EQUAL (PLUS V (TIMES Z W)) 1))
		      (EQUAL V 0))
		 (NOT (PRIME1 (PLUS V (TIMES Z W))
			      (SUB1 (PLUS V (TIMES Z W)))))),

  which simplifies, rewriting with COMMUTATIVITY-OF-TIMES,
  TIMES-ID-IFF-1, EQUAL-TIMES-0, GREATEREQPR-REMAINDER, ADD1-SUB1,
  DIVIDES-TIMES, and PRIME1-BASIC, and opening up NUMBERP, EQUAL,
  LESSP, ZEROP, NOT, PLUS, and DIVIDES, to:

        T.

Q.E.D.


[ 3.54899088 0.25402018 ]

PRIME-BASIC 


(PROVE-LEMMA REMAINDER-GCD
	     (REWRITE)
	     (IMPLIES (EQUAL (GCD B X) Y)
		      (EQUAL (REMAINDER B Y) 0.)))

WARNING:  Note that REMAINDER-GCD contains the free variable X which
will be chosen by instantiating the hypothesis (EQUAL (GCD B X) Y).

This formula simplifies, rewriting with GCD-DIVIDES-BOTH, and
unfolding the function EQUAL, to:

      T.

Q.E.D.


[ 1.1610026 0.052994792 ]

REMAINDER-GCD 


(PROVE-LEMMA REMAINDER-GCD-1
	     (REWRITE)
	     (IMPLIES (NOT (EQUAL (REMAINDER B X) 0.))
		      (NOT (EQUAL (GCD B X) X))))
This conjecture simplifies, applying REMAINDER-GCD, and expanding
EQUAL, to:

      T.

Q.E.D.


[ 0.198046874 0.0189778646 ]

REMAINDER-GCD-1 


(PROVE-LEMMA DIVIDES-TIMES1
	     (REWRITE)
	     (IMPLIES (EQUAL A (TIMES Z Y))
		      (EQUAL (REMAINDER A Z) 0.)))

WARNING:  Note that DIVIDES-TIMES1 contains the free variable Y which
will be chosen by instantiating the hypothesis (EQUAL A (TIMES Z Y)).

This formula simplifies, rewriting with COMMUTATIVITY-OF-TIMES and
DIVIDES-TIMES, and unfolding the function EQUAL, to:

      T.

Q.E.D.


[ 0.183968099 0.0220214843 ]

DIVIDES-TIMES1 


(PROVE-LEMMA TIMES-IDENTITY1
	     (REWRITE)
	     (IMPLIES (AND (NUMBERP Y)
			   (NOT (EQUAL Y 1.))
			   (NOT (EQUAL Y 0.))
			   (NOT (EQUAL X 0.)))
		      (NOT (EQUAL X (TIMES X Y)))))
.

We now use the above equality hypothesis by substituting (TIMES X Y)
for X and keeping the equality hypothesis.  This generates the goal:

      (IMPLIES (AND (NUMBERP Y)
		    (NOT (EQUAL Y 1))
		    (NOT (EQUAL Y 0))
		    (NOT (EQUAL (TIMES X Y) 0)))
	       (NOT (EQUAL X (TIMES X Y)))),

which simplifies, trivially, to:

      (IMPLIES (AND (NUMBERP Y)
		    (NOT (EQUAL Y 1))
		    (NOT (EQUAL Y 0))
		    (NOT (EQUAL X 0)))
	       (NOT (EQUAL X (TIMES X Y)))),

which we would normally push and work on later by induction.  But if
we must use induction to prove the input conjecture, we prefer to
induct on the original formulation of the problem.  Thus we will
disregard all that we have previously done, give the name *1 to the
original input, and work on it.


     So now let us return to:

(IMPLIES (AND (NUMBERP Y)
	      (NOT (EQUAL Y 1))
	      (NOT (EQUAL Y 0))
	      (NOT (EQUAL X 0)))
	 (NOT (EQUAL X (TIMES X Y)))),

named *1.  We will try to prove it by induction.  There is only one
plausible induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (ZEROP X) (P X Y))
	   (IMPLIES (AND (NOT (ZEROP X)) (P (SUB1 X) Y))
		    (P X Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP can be used to establish that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme generates the following
three new conjectures:

Case 3. (IMPLIES (AND (ZEROP X)
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1))
		      (NOT (EQUAL Y 0))
		      (NOT (EQUAL X 0)))
		 (NOT (EQUAL X (TIMES X Y)))),

  which we simplify, opening up ZEROP, to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP X))
		      (EQUAL (SUB1 X) 0)
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1))
		      (NOT (EQUAL Y 0))
		      (NOT (EQUAL X 0)))
		 (NOT (EQUAL X (TIMES X Y)))),

  which we simplify, unfolding ZEROP and TIMES, to the goal:

        (IMPLIES (AND (EQUAL (SUB1 X) 0)
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1))
		      (NOT (EQUAL Y 0))
		      (NOT (EQUAL X 0))
		      (NUMBERP X))
		 (NOT (EQUAL X
			     (PLUS Y (TIMES (SUB1 X) Y))))),

  which again simplifies, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP X))
		      (NOT (EQUAL (SUB1 X) (TIMES (SUB1 X) Y)))
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1))
		      (NOT (EQUAL Y 0))
		      (NOT (EQUAL X 0)))
		 (NOT (EQUAL X (TIMES X Y)))),

  which we simplify, unfolding the functions ZEROP and TIMES, to:

        (IMPLIES (AND (NOT (EQUAL (SUB1 X) (TIMES (SUB1 X) Y)))
		      (NUMBERP Y)
		      (NOT (EQUAL Y 1))
		      (NOT (EQUAL Y 0))
		      (NOT (EQUAL X 0))
		      (NUMBERP X))
		 (NOT (EQUAL X
			     (PLUS Y (TIMES (SUB1 X) Y))))),

  which again simplifies, using linear arithmetic and applying
  LESSP-TIMES-2, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 2.8060384 0.39396159 ]

TIMES-IDENTITY1 


(PROVE-LEMMA TIMES-IDENTITY
	     (REWRITE)
	     (EQUAL (EQUAL X (TIMES X Y))
		    (OR (EQUAL X 0.)
			(AND (NUMBERP X) (EQUAL Y 1.)))))
This formula simplifies, opening up the definitions of AND and OR, to
the following four new formulas:

Case 4. (IMPLIES (AND (EQUAL X (TIMES X Y))
		      (NOT (EQUAL X 0)))
		 (EQUAL (EQUAL Y 1) T)).

  Of course, this simplifies again, clearly, to:

        (IMPLIES (AND (EQUAL X (TIMES X Y))
		      (NOT (EQUAL X 0)))
		 (EQUAL Y 1)).

  We now use the above equality hypothesis by substituting
  (TIMES X Y) for X and keeping the equality hypothesis.  This
  generates the new formula:

        (IMPLIES (AND (EQUAL X (TIMES X Y))
		      (NOT (EQUAL (TIMES X Y) 0)))
		 (EQUAL Y 1)).

  This further simplifies, clearly, to:

        (IMPLIES (AND (EQUAL X (TIMES X Y))
		      (NOT (EQUAL X 0)))
		 (EQUAL Y 1)),

  which we would normally push and work on later by induction.  But
  if we must use induction to prove the input conjecture, we prefer
  to induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us consider:

(EQUAL (EQUAL X (TIMES X Y))
       (OR (EQUAL X 0)
	   (AND (NUMBERP X) (EQUAL Y 1)))),

which we named *1 above.  We will try to prove it by induction.
There is only one suggested induction.  We will induct according to
the following scheme:
      (AND (IMPLIES (ZEROP X) (P X Y))
	   (IMPLIES (AND (NOT (ZEROP X)) (P (SUB1 X) Y))
		    (P X Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP can be used to prove that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme produces the following two
new formulas:

Case 2. (IMPLIES (ZEROP X)
		 (EQUAL (EQUAL X (TIMES X Y))
			(OR (EQUAL X 0)
			    (AND (NUMBERP X) (EQUAL Y 1))))).

  This simplifies, expanding ZEROP, EQUAL, TIMES, NUMBERP, AND, and
  OR, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP X))
		      (EQUAL (EQUAL (SUB1 X) (TIMES (SUB1 X) Y))
			     (OR (EQUAL (SUB1 X) 0)
				 (AND (NUMBERP (SUB1 X))
				      (EQUAL Y 1)))))
		 (EQUAL (EQUAL X (TIMES X Y))
			(OR (EQUAL X 0)
			    (AND (NUMBERP X) (EQUAL Y 1))))),

  which we simplify, expanding the definitions of ZEROP, AND, OR, and
  TIMES, to four new conjectures:

  Case 1.4.
          (IMPLIES (AND (NOT (EQUAL X 0))
			(NUMBERP X)
			(EQUAL (SUB1 X) (TIMES (SUB1 X) Y))
			(EQUAL (EQUAL Y 1) T))
		   (EQUAL X (PLUS Y (SUB1 X)))),

    which we again simplify, rewriting with ADD1-SUB1, and unfolding
    the definitions of SUB1, NUMBERP, EQUAL, and PLUS, to:

          T.

  Case 1.3.
          (IMPLIES (AND (NOT (EQUAL X 0))
			(NUMBERP X)
			(NOT (EQUAL (SUB1 X) (TIMES (SUB1 X) Y)))
			(NOT (EQUAL (SUB1 X) 0))
			(NOT (EQUAL Y 1)))
		   (NOT (EQUAL X
			       (PLUS Y (TIMES (SUB1 X) Y))))).

    This simplifies again, clearly, to the new conjecture:

          (IMPLIES (AND (NOT (EQUAL X 0))
			(NOT (EQUAL (SUB1 X) (TIMES (SUB1 X) Y)))
			(NOT (EQUAL (SUB1 X) 0))
			(NOT (EQUAL Y 1)))
		   (NOT (EQUAL X
			       (PLUS Y (TIMES (SUB1 X) Y))))),

    which we further simplify, rewriting with COMMUTATIVITY-OF-TIMES
    and TIMES-ID-IFF-1, to:

          (IMPLIES (AND (NOT (EQUAL X 0))
			(NOT (EQUAL (SUB1 X) 0))
			(NOT (EQUAL Y 1)))
		   (NOT (EQUAL X
			       (PLUS Y (TIMES Y (SUB1 X)))))).

    Applying the lemma SUB1-ELIM, replace X by (ADD1 Z) to eliminate
    (SUB1 X).  We employ the type restriction lemma noted when SUB1
    was introduced to constrain the new variable.  We thus obtain the
    following two new conjectures:

    Case 1.3.2.
            (IMPLIES (AND (NOT (NUMBERP X))
			  (NOT (EQUAL X 0))
			  (NOT (EQUAL (SUB1 X) 0))
			  (NOT (EQUAL Y 1)))
		     (NOT (EQUAL X
				 (PLUS Y (TIMES Y (SUB1 X)))))),

      which further simplifies, obviously, to:

            T.

    Case 1.3.1.
            (IMPLIES (AND (NUMBERP Z)
			  (NOT (EQUAL (ADD1 Z) 0))
			  (NOT (EQUAL Z 0))
			  (NOT (EQUAL Y 1)))
		     (NOT (EQUAL (ADD1 Z)
				 (PLUS Y (TIMES Y Z))))).

      This further simplifies, clearly, to the new formula:

            (IMPLIES (AND (NUMBERP Z)
			  (NOT (EQUAL Z 0))
			  (NOT (EQUAL Y 1)))
		     (NOT (EQUAL (ADD1 Z)
				 (PLUS Y (TIMES Y Z))))),

      which we will finally name *1.1.

  Case 1.2.
          (IMPLIES (AND (NOT (EQUAL X 0))
			(NUMBERP X)
			(EQUAL (SUB1 X) (TIMES (SUB1 X) Y))
			(EQUAL (SUB1 X) 0)
			(NOT (EQUAL Y 1)))
		   (NOT (EQUAL X (PLUS Y (SUB1 X))))),

    which again simplifies, using linear arithmetic, to:

          (IMPLIES (AND (NOT (NUMBERP Y))
			(NOT (EQUAL X 0))
			(NUMBERP X)
			(EQUAL 0 (TIMES 0 Y))
			(EQUAL (SUB1 X) 0)
			(NOT (EQUAL Y 1)))
		   (NOT (EQUAL X (PLUS Y 0)))),

    which we again simplify, applying PLUS-RIGHT-ID2 and
    COMMUTATIVITY-OF-PLUS, and opening up the definitions of NUMBERP
    and EQUAL, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NOT (EQUAL X 0))
			(NUMBERP X)
			(EQUAL (SUB1 X) (TIMES (SUB1 X) Y))
			(EQUAL (SUB1 X) 0)
			(EQUAL Y 1))
		   (EQUAL (EQUAL X (PLUS Y (SUB1 X)))
			  T)),

    which we again simplify, expanding the functions TIMES, EQUAL,
    and PLUS, to:

          (IMPLIES (AND (NOT (EQUAL X 0))
			(NUMBERP X)
			(EQUAL (SUB1 X) 0))
		   (EQUAL X 1)),

    which we again simplify, using linear arithmetic, to:

          T.


     So next consider:

      (IMPLIES (AND (NUMBERP Z)
		    (NOT (EQUAL Z 0))
		    (NOT (EQUAL Y 1)))
	       (NOT (EQUAL (ADD1 Z)
			   (PLUS Y (TIMES Y Z))))),

named *1.1 above.  Let us appeal to the induction principle.  There
are two plausible inductions.  However, they merge into one likely
candidate induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (ZEROP Y) (P Z Y))
	   (IMPLIES (AND (NOT (ZEROP Y)) (P Z (SUB1 Y)))
		    (P Z Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP establish that the measure (COUNT Y) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme produces the following three new goals:

Case 3. (IMPLIES (AND (ZEROP Y)
		      (NUMBERP Z)
		      (NOT (EQUAL Z 0))
		      (NOT (EQUAL Y 1)))
		 (NOT (EQUAL (ADD1 Z)
			     (PLUS Y (TIMES Y Z))))),

  which simplifies, applying PLUS-RIGHT-ID2 and COMMUTATIVITY-OF-PLUS,
  and unfolding the definitions of ZEROP, EQUAL, TIMES, PLUS, and
  NUMBERP, to:

        T.

Case 2. (IMPLIES (AND (NOT (ZEROP Y))
		      (EQUAL (SUB1 Y) 1)
		      (NUMBERP Z)
		      (NOT (EQUAL Z 0))
		      (NOT (EQUAL Y 1)))
		 (NOT (EQUAL (ADD1 Z)
			     (PLUS Y (TIMES Y Z))))).

  This simplifies, unfolding the definitions of ZEROP and TIMES, to
  the new conjecture:

        (IMPLIES (AND (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (EQUAL (SUB1 Y) 1)
		      (NUMBERP Z)
		      (NOT (EQUAL Z 0))
		      (NOT (EQUAL Y 1)))
		 (NOT (EQUAL (ADD1 Z)
			     (PLUS Y
				   (PLUS Z (TIMES (SUB1 Y) Z)))))),

  which we again simplify, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP Y))
		      (NOT (EQUAL (ADD1 Z)
				  (PLUS (SUB1 Y) (TIMES (SUB1 Y) Z))))
		      (NUMBERP Z)
		      (NOT (EQUAL Z 0))
		      (NOT (EQUAL Y 1)))
		 (NOT (EQUAL (ADD1 Z)
			     (PLUS Y (TIMES Y Z))))).

  This simplifies, opening up the functions ZEROP and TIMES, to:

        (IMPLIES (AND (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NOT (EQUAL (ADD1 Z)
				  (PLUS (SUB1 Y) (TIMES (SUB1 Y) Z))))
		      (NUMBERP Z)
		      (NOT (EQUAL Z 0))
		      (NOT (EQUAL Y 1)))
		 (NOT (EQUAL (ADD1 Z)
			     (PLUS Y
				   (PLUS Z (TIMES (SUB1 Y) Z)))))).

  This simplifies again, using linear arithmetic and rewriting with
  LESSP-TIMES-2, to:

        T.


     That finishes the proof of *1.1, which, consequently, also
finishes the proof of *1.  Q.E.D.


[ 6.2329915 1.84200846 ]

TIMES-IDENTITY 


(PROVE-LEMMA KLUDGE-BRIDGE
	     (REWRITE)
	     (IMPLIES (EQUAL Y (TIMES K X))
		      (EQUAL (GCD Y (TIMES A X))
			     (TIMES X (GCD A K)))))

WARNING:  Note that KLUDGE-BRIDGE contains the free variable K which
will be chosen by instantiating the hypothesis (EQUAL Y (TIMES K X)).

This formula simplifies, applying COMMUTATIVITY-OF-GCD and
DISTRIBUTIVITY-OF-TIMES-OVER-GCD, to:

      T.

Q.E.D.


[ 2.13401693 0.123990885 ]

KLUDGE-BRIDGE 


(PROVE-LEMMA HACK1
	     (REWRITE)
	     (IMPLIES (AND (NOT (DIVIDES X A))
			   (EQUAL A
				  (GCD (TIMES X A) (TIMES B A))))
		      (NOT (EQUAL (TIMES K X) (TIMES B A)))))
This conjecture can be simplified, using the abbreviations NOT, AND,
IMPLIES, DISTRIBUTIVITY-OF-TIMES-OVER-GCD, and DIVIDES, to the goal:

      (IMPLIES (AND (NOT (EQUAL (REMAINDER A X) 0))
		    (EQUAL A (TIMES A (GCD X B))))
	       (NOT (EQUAL (TIMES K X) (TIMES B A)))),

which simplifies, applying the lemmas COMMUTATIVITY-OF-GCD,
TIMES-IDENTITY, COMMUTATIVITY-OF-TIMES, and EQUAL-TIMES-0, and
expanding the definitions of EQUAL and TIMES, to five new goals:

Case 5. (IMPLIES (AND (NOT (EQUAL (REMAINDER A X) 0))
		      (EQUAL A 0))
		 (NOT (EQUAL K 0))),

  which we again simplify, rewriting with REMAINDER-0-CROCK, and
  unfolding the definition of EQUAL, to:

        T.

Case 4. (IMPLIES (AND (NOT (EQUAL (REMAINDER A X) 0))
		      (EQUAL A 0))
		 (NUMBERP K)).

  This simplifies again, applying REMAINDER-0-CROCK, and opening up
  EQUAL, to:

        T.

Case 3. (IMPLIES (AND (NOT (EQUAL (REMAINDER A X) 0))
		      (EQUAL A 0))
		 (NOT (EQUAL X 0))),

  which we again simplify, unfolding REMAINDER and EQUAL, to:

        T.

Case 2. (IMPLIES (AND (NOT (EQUAL (REMAINDER A X) 0))
		      (EQUAL A 0))
		 (NUMBERP X)).

  But this again simplifies, rewriting with REMAINDER-0-CROCK, and
  expanding EQUAL, to:

        T.

Case 1. (IMPLIES (AND (NOT (EQUAL (REMAINDER A X) 0))
		      (NUMBERP A)
		      (EQUAL (GCD B X) 1))
		 (NOT (EQUAL (TIMES K X) (TIMES A B)))).

  Applying the lemma REMAINDER-QUOTIENT-ELIM, we now replace A by
  (PLUS Z (TIMES X V)) to eliminate (REMAINDER A X) and
  (QUOTIENT A X).  We use LESSP-REMAINDER2, the type restriction
  lemma noted when REMAINDER was introduced, and the type restriction
  lemma noted when QUOTIENT was introduced to constrain the new
  variables.  We would thus like to prove the following three new
  conjectures:

  Case 1.3.
          (IMPLIES (AND (EQUAL X 0)
			(NOT (EQUAL (REMAINDER A X) 0))
			(NUMBERP A)
			(EQUAL (GCD B X) 1))
		   (NOT (EQUAL (TIMES K X) (TIMES A B)))),

    which we further simplify, rewriting with GCD-0,
    COMMUTATIVITY-OF-GCD, COMMUTATIVITY-OF-TIMES, and
    COMMUTATIVITY-OF-PLUS, and unfolding EQUAL, REMAINDER, TIMES,
    SUB1, NUMBERP, and PLUS, to:

          T.

  Case 1.2.
          (IMPLIES (AND (NOT (NUMBERP X))
			(NOT (EQUAL (REMAINDER A X) 0))
			(NUMBERP A)
			(EQUAL (GCD B X) 1))
		   (NOT (EQUAL (TIMES K X) (TIMES A B)))),

    which further simplifies, rewriting with REMAINDER-WRT-12,
    TIMES-ZERO2, COMMUTATIVITY-OF-PLUS, and COMMUTATIVITY-OF-TIMES,
    and expanding the definitions of GCD, SUB1, NUMBERP, EQUAL, TIMES,
    and PLUS, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NUMBERP Z)
			(EQUAL (LESSP Z X) (NOT (ZEROP X)))
			(NUMBERP V)
			(NUMBERP X)
			(NOT (EQUAL X 0))
			(NOT (EQUAL Z 0))
			(EQUAL (GCD B X) 1))
		   (NOT (EQUAL (TIMES K X)
			       (TIMES (PLUS Z (TIMES X V)) B)))).

    However this further simplifies, rewriting with the lemmas
    COMMUTATIVITY-OF-TIMES and DISTRIBUTIVITY-OF-TIMES-OVER-PLUS, and
    unfolding the definitions of ZEROP and NOT, to the formula:

          (IMPLIES (AND (NUMBERP Z)
			(LESSP Z X)
			(NUMBERP V)
			(NUMBERP X)
			(NOT (EQUAL X 0))
			(NOT (EQUAL Z 0))
			(EQUAL (GCD B X) 1))
		   (NOT (EQUAL (TIMES K X)
			       (PLUS (TIMES B Z)
				     (TIMES B (TIMES V X)))))),

    which we would normally push and work on later by induction.  But
    if we must use induction to prove the input conjecture, we prefer
    to induct on the original formulation of the problem.  Thus we
    will disregard all that we have previously done, give the name *1
    to the original input, and work on it.


     So now let us consider:

(IMPLIES (AND (NOT (DIVIDES X A))
	      (EQUAL A
		     (GCD (TIMES X A) (TIMES B A))))
	 (NOT (EQUAL (TIMES K X) (TIMES B A)))),

which we named *1 above.  Let us appeal to the induction principle.
There are four plausible inductions.  They merge into three likely
candidate inductions, two of which are unflawed.  However, one of
these is more likely than the other.  We will induct according to the
following scheme:
      (AND (IMPLIES (ZEROP B) (P K X B A))
	   (IMPLIES (AND (NOT (ZEROP B))
			 (P K X (SUB1 B) A))
		    (P K X B A))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP can be used to show that the measure (COUNT B) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme generates the following
three new conjectures:

Case 3. (IMPLIES (AND (ZEROP B)
		      (NOT (DIVIDES X A))
		      (EQUAL A
			     (GCD (TIMES X A) (TIMES B A))))
		 (NOT (EQUAL (TIMES K X) (TIMES B A)))).

  This simplifies, rewriting with COMMUTATIVITY-OF-TIMES, GCD-0,
  COMMUTATIVITY-OF-GCD, TIMES-IDENTITY, EQUAL-TIMES-0, and
  TIMES-ZERO2, and expanding the functions ZEROP, DIVIDES, EQUAL,
  TIMES, and NUMBERP, to the following 12 new conjectures:

  Case 3.12.
          (IMPLIES (AND (EQUAL B 0)
			(NOT (EQUAL (REMAINDER A X) 0))
			(EQUAL A 0))
		   (NOT (EQUAL K 0))),

    which we again simplify, applying REMAINDER-0-CROCK, and opening
    up the definition of EQUAL, to:

          T.

  Case 3.11.
          (IMPLIES (AND (EQUAL B 0)
			(NOT (EQUAL (REMAINDER A X) 0))
			(EQUAL A 0))
		   (NUMBERP K)),

    which we again simplify, applying REMAINDER-0-CROCK, and opening
    up the definition of EQUAL, to:

          T.

  Case 3.10.
          (IMPLIES (AND (EQUAL B 0)
			(NOT (EQUAL (REMAINDER A X) 0))
			(EQUAL A 0))
		   (NOT (EQUAL X 0))),

    which we again simplify, opening up the functions REMAINDER and
    EQUAL, to:

          T.

  Case 3.9.
          (IMPLIES (AND (EQUAL B 0)
			(NOT (EQUAL (REMAINDER A X) 0))
			(EQUAL A 0))
		   (NUMBERP X)),

    which again simplifies, applying REMAINDER-0-CROCK, and opening
    up the definition of EQUAL, to:

          T.

  Case 3.8.
          (IMPLIES (AND (EQUAL B 0)
			(NOT (EQUAL (REMAINDER A X) 0))
			(NUMBERP A)
			(EQUAL X 1))
		   (NOT (EQUAL K 0))),

    which we again simplify, applying REMAINDER-WRT-1, and expanding
    EQUAL, to:

          T.

  Case 3.7.
          (IMPLIES (AND (EQUAL B 0)
			(NOT (EQUAL (REMAINDER A X) 0))
			(NUMBERP A)
			(EQUAL X 1))
		   (NUMBERP K)).

    This simplifies again, rewriting with REMAINDER-WRT-1, and
    expanding the function EQUAL, to:

          T.

  Case 3.6.
          (IMPLIES (AND (NOT (NUMBERP B))
			(NOT (EQUAL (REMAINDER A X) 0))
			(EQUAL A 0))
		   (NOT (EQUAL K 0))),

    which we again simplify, applying the lemma REMAINDER-0-CROCK,
    and expanding the function EQUAL, to:

          T.

  Case 3.5.
          (IMPLIES (AND (NOT (NUMBERP B))
			(NOT (EQUAL (REMAINDER A X) 0))
			(EQUAL A 0))
		   (NUMBERP K)),

    which again simplifies, rewriting with REMAINDER-0-CROCK, and
    expanding the definition of EQUAL, to:

          T.

  Case 3.4.
          (IMPLIES (AND (NOT (NUMBERP B))
			(NOT (EQUAL (REMAINDER A X) 0))
			(EQUAL A 0))
		   (NOT (EQUAL X 0))),

    which again simplifies, expanding the functions REMAINDER and
    EQUAL, to:

          T.

  Case 3.3.
          (IMPLIES (AND (NOT (NUMBERP B))
			(NOT (EQUAL (REMAINDER A X) 0))
			(EQUAL A 0))
		   (NUMBERP X)).

    However this simplifies again, rewriting with the lemma
    REMAINDER-0-CROCK, and unfolding the definition of EQUAL, to:

          T.

  Case 3.2.
          (IMPLIES (AND (NOT (NUMBERP B))
			(NOT (EQUAL (REMAINDER A X) 0))
			(NUMBERP A)
			(EQUAL X 1))
		   (NOT (EQUAL K 0))).

    However this again simplifies, appealing to the lemma
    REMAINDER-WRT-1, and opening up EQUAL, to:

          T.

  Case 3.1.
          (IMPLIES (AND (NOT (NUMBERP B))
			(NOT (EQUAL (REMAINDER A X) 0))
			(NUMBERP A)
			(EQUAL X 1))
		   (NUMBERP K)).

    However this again simplifies, applying the lemma REMAINDER-WRT-1,
    and unfolding the definition of EQUAL, to:

          T.

Case 2. (IMPLIES
	       (AND (NOT (ZEROP B))
		    (NOT (EQUAL A
				(GCD (TIMES X A) (TIMES (SUB1 B) A))))
		    (NOT (DIVIDES X A))
		    (EQUAL A
			   (GCD (TIMES X A) (TIMES B A))))
	       (NOT (EQUAL (TIMES K X) (TIMES B A)))).

  This simplifies, rewriting with the lemmas COMMUTATIVITY-OF-TIMES
  and COMMUTATIVITY-OF-GCD, and unfolding the definitions of ZEROP
  and DIVIDES, to:

        (IMPLIES
	       (AND (NOT (EQUAL B 0))
		    (NUMBERP B)
		    (NOT (EQUAL A
				(GCD (TIMES A X) (TIMES (SUB1 B) A))))
		    (NOT (EQUAL (REMAINDER A X) 0))
		    (EQUAL A
			   (GCD (TIMES A B) (TIMES A X))))
	       (NOT (EQUAL (TIMES K X) (TIMES A B)))).

  However this again simplifies, rewriting with KLUDGE-BRIDGE, to the
  formula:

        (IMPLIES
	       (AND (NOT (EQUAL B 0))
		    (NUMBERP B)
		    (NOT (EQUAL A
				(GCD (TIMES A X) (TIMES (SUB1 B) A))))
		    (NOT (EQUAL (REMAINDER A X) 0))
		    (EQUAL A (TIMES X (GCD A K))))
	       (NOT (EQUAL (TIMES K X) (TIMES A B)))),

  which again simplifies, applying DIVIDES-TIMES1, and unfolding the
  definition of EQUAL, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP B))
		      (NOT (EQUAL (TIMES K X)
				  (TIMES (SUB1 B) A)))
		      (NOT (DIVIDES X A))
		      (EQUAL A
			     (GCD (TIMES X A) (TIMES B A))))
		 (NOT (EQUAL (TIMES K X) (TIMES B A)))).

  This simplifies, rewriting with COMMUTATIVITY-OF-TIMES and
  COMMUTATIVITY-OF-GCD, and opening up the functions ZEROP and
  DIVIDES, to:

        (IMPLIES (AND (NOT (EQUAL B 0))
		      (NUMBERP B)
		      (NOT (EQUAL (TIMES A B)
				  (TIMES (SUB1 B) A)))
		      (NOT (EQUAL (REMAINDER A X) 0))
		      (EQUAL A
			     (GCD (TIMES A B) (TIMES A X))))
		 (NOT (EQUAL (TIMES K X) (TIMES A B)))).

  However this simplifies again, applying KLUDGE-BRIDGE, to:

        (IMPLIES (AND (NOT (EQUAL B 0))
		      (NUMBERP B)
		      (NOT (EQUAL (TIMES A B)
				  (TIMES (SUB1 B) A)))
		      (NOT (EQUAL (REMAINDER A X) 0))
		      (EQUAL A (TIMES X (GCD A K))))
		 (NOT (EQUAL (TIMES K X) (TIMES A B)))).

  But this simplifies again, appealing to the lemma DIVIDES-TIMES1,
  and unfolding EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 17.7220216 1.2769694 ]

HACK1 


(PROVE-LEMMA PRIME-GCD
	     (REWRITE)
	     (IMPLIES (AND (NOT (DIVIDES X B))
			   (NOT (ZEROP X))
			   (NOT (EQUAL (SUB1 X) 0.))
			   (PRIME1 X (SUB1 X)))
		      (EQUAL (EQUAL (GCD B X) 1.) T))
	     NIL)
This formula can be simplified, using the abbreviations ZEROP, NOT,
AND, IMPLIES, and DIVIDES, to:

      (IMPLIES (AND (NOT (EQUAL (REMAINDER B X) 0))
		    (NOT (EQUAL X 0))
		    (NUMBERP X)
		    (NOT (EQUAL (SUB1 X) 0))
		    (PRIME1 X (SUB1 X)))
	       (EQUAL (EQUAL (GCD B X) 1) T)).

This simplifies, using linear arithmetic, applying GCD-DIVIDES-BOTH,
REMAINDER-GCD-1, and PRIME-BASIC, and expanding DIVIDES and EQUAL, to:

      T.

Q.E.D.


[ 0.649007164 0.0599934896 ]

PRIME-GCD 


(PROVE-LEMMA GCD-DISTRIBUTES-OVER-AN-OPENED-UP-TIMES
	     (REWRITE)
	     (IMPLIES (AND (NUMBERP X)
			   (NOT (EQUAL X 0.))
			   (EQUAL FREE (TIMES X Z)))
		      (EQUAL (GCD (TIMES B Z) FREE)
			     (TIMES Z (GCD B X))))
	     NIL)

WARNING:  Note that GCD-DISTRIBUTES-OVER-AN-OPENED-UP-TIMES contains
the free variable X which will be chosen by instantiating the
hypothesis (NUMBERP X).

This formula simplifies, applying DISTRIBUTIVITY-OF-TIMES-OVER-GCD,
to:

      T.

Q.E.D.


[ 1.1809733 0.0150227865 ]

GCD-DISTRIBUTES-OVER-AN-OPENED-UP-TIMES 


(PROVE-LEMMA PRIME-KEY
	     (REWRITE)
	     (IMPLIES (AND (NUMBERP Z)
			   (PRIME X)
			   (NOT (DIVIDES X Z))
			   (NOT (DIVIDES X B)))
		      (NOT (EQUAL (TIMES X K) (TIMES B Z)))))
This formula can be simplified, using the abbreviations NOT, PRIME,
AND, IMPLIES, and DIVIDES, to the new conjecture:

      (IMPLIES (AND (NUMBERP Z)
		    (NOT (EQUAL X 0))
		    (NUMBERP X)
		    (NOT (EQUAL X 1))
		    (PRIME1 X (SUB1 X))
		    (NOT (EQUAL (REMAINDER Z X) 0))
		    (NOT (EQUAL (REMAINDER B X) 0)))
	       (NOT (EQUAL (TIMES X K) (TIMES B Z)))).

This simplifies, using linear arithmetic, rewriting with
COMMUTATIVITY-OF-TIMES, TIMES-IDENTITY, PRIME-GCD,
COMMUTATIVITY-OF-GCD, GCD-DISTRIBUTES-OVER-AN-OPENED-UP-TIMES, and
HACK1, and opening up the definitions of TIMES and DIVIDES, to:

      T.

Q.E.D.


[ 4.8499674 0.074023438 ]

PRIME-KEY 


(PROVE-LEMMA QUOTIENT-DIVIDES
	     (REWRITE)
	     (IMPLIES (AND (NUMBERP Y)
			   (NOT (EQUAL (TIMES X (QUOTIENT Y X)) Y)))
		      (NOT (EQUAL (REMAINDER Y X) 0.))))
.

Applying the lemma REMAINDER-QUOTIENT-ELIM, replace Y by
(PLUS V (TIMES X Z)) to eliminate (QUOTIENT Y X) and (REMAINDER Y X).
We use LESSP-REMAINDER2, the type restriction lemma noted when
QUOTIENT was introduced, and the type restriction lemma noted when
REMAINDER was introduced to constrain the new variables.  We would
thus like to prove the following three new formulas:

Case 3. (IMPLIES (AND (EQUAL X 0)
		      (NUMBERP Y)
		      (NOT (EQUAL (TIMES X (QUOTIENT Y X)) Y)))
		 (NOT (EQUAL (REMAINDER Y X) 0))).

  But this simplifies, unfolding EQUAL, QUOTIENT, TIMES, and
  REMAINDER, to:

        T.

Case 2. (IMPLIES (AND (NOT (NUMBERP X))
		      (NUMBERP Y)
		      (NOT (EQUAL (TIMES X (QUOTIENT Y X)) Y)))
		 (NOT (EQUAL (REMAINDER Y X) 0))),

  which simplifies, applying TIMES-ZERO2, COMMUTATIVITY-OF-TIMES, and
  REMAINDER-WRT-12, and expanding the definition of QUOTIENT, to:

        T.

Case 1. (IMPLIES (AND (NUMBERP Z)
		      (NUMBERP V)
		      (EQUAL (LESSP V X) (NOT (ZEROP X)))
		      (NUMBERP X)
		      (NOT (EQUAL X 0))
		      (NOT (EQUAL (TIMES X Z)
				  (PLUS V (TIMES X Z)))))
		 (NOT (EQUAL V 0))),

  which simplifies, using linear arithmetic, to:

        T.

Q.E.D.


[ 1.12294921 0.147054037 ]

QUOTIENT-DIVIDES 


(PROVE-LEMMA LITTLE-STEP
	     (REWRITE)
	     (IMPLIES (AND (PRIME X)
			   (NOT (EQUAL Y 1.))
			   (NOT (EQUAL X Y)))
		      (NOT (EQUAL (REMAINDER X Y) 0.))))
This formula can be simplified, using the abbreviations NOT, PRIME,
AND, and IMPLIES, to:

      (IMPLIES (AND (NOT (EQUAL X 0))
		    (NUMBERP X)
		    (NOT (EQUAL X 1))
		    (PRIME1 X (SUB1 X))
		    (NOT (EQUAL Y 1))
		    (NOT (EQUAL X Y)))
	       (NOT (EQUAL (REMAINDER X Y) 0))).

This simplifies, applying PRIME-BASIC, and expanding DIVIDES and
EQUAL, to:

      T.

Q.E.D.


[ 0.586035155 0.0509765623 ]

LITTLE-STEP 


(PROVE-LEMMA LESSP-COUNT-DELETE
	     (REWRITE)
	     (IMPLIES (MEMBER N L)
		      (LESSP (COUNT (DELETE N L))
			     (COUNT L))))

     Call the conjecture *1.


     Perhaps we can prove it by induction.  There are two plausible
inductions.  However, they merge into one likely candidate induction.
We will induct according to the following scheme:
      (AND (IMPLIES (NLISTP L) (P N L))
	   (IMPLIES (AND (NOT (NLISTP L))
			 (EQUAL N (CAR L)))
		    (P N L))
	   (IMPLIES (AND (NOT (NLISTP L))
			 (NOT (EQUAL N (CAR L)))
			 (P N (CDR L)))
		    (P N L))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP establish that the measure (COUNT L) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme generates the following
four new formulas:

Case 4. (IMPLIES (AND (NLISTP L) (MEMBER N L))
		 (LESSP (COUNT (DELETE N L))
			(COUNT L))).

  This simplifies, expanding NLISTP and MEMBER, to:

        T.

Case 3. (IMPLIES (AND (NOT (NLISTP L))
		      (EQUAL N (CAR L))
		      (MEMBER N L))
		 (LESSP (COUNT (DELETE N L))
			(COUNT L))).

  This simplifies, opening up the definitions of NLISTP, MEMBER, and
  DELETE, to:

        (IMPLIES (LISTP L)
		 (LESSP (COUNT (CDR L)) (COUNT L))),

  which we again simplify, using linear arithmetic and rewriting with
  CDR-LESSP, to:

        T.

Case 2. (IMPLIES (AND (NOT (NLISTP L))
		      (NOT (EQUAL N (CAR L)))
		      (NOT (MEMBER N (CDR L)))
		      (MEMBER N L))
		 (LESSP (COUNT (DELETE N L))
			(COUNT L))),

  which we simplify, unfolding NLISTP and MEMBER, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP L))
		      (NOT (EQUAL N (CAR L)))
		      (LESSP (COUNT (DELETE N (CDR L)))
			     (COUNT (CDR L)))
		      (MEMBER N L))
		 (LESSP (COUNT (DELETE N L))
			(COUNT L))).

  This simplifies, rewriting with the lemmas COUNT-CONS and SUB1-ADD1,
  and expanding NLISTP, MEMBER, DELETE, and LESSP, to two new
  formulas:

  Case 1.2.
          (IMPLIES (AND (LISTP L)
			(NOT (EQUAL N (CAR L)))
			(LESSP (COUNT (DELETE N (CDR L)))
			       (COUNT (CDR L)))
			(MEMBER N (CDR L)))
		   (NOT (EQUAL (COUNT L) 0))),

    which we again simplify, using linear arithmetic and applying
    CDR-LESSEQP, to:

          T.

  Case 1.1.
          (IMPLIES (AND (LISTP L)
			(NOT (EQUAL N (CAR L)))
			(LESSP (COUNT (DELETE N (CDR L)))
			       (COUNT (CDR L)))
			(MEMBER N (CDR L)))
		   (LESSP (PLUS (COUNT (CAR L))
				(COUNT (DELETE N (CDR L))))
			  (SUB1 (COUNT L)))).

    Appealing to the lemma CAR-CDR-ELIM, we now replace L by
    (CONS X Z) to eliminate (CAR L) and (CDR L).  We would thus like
    to prove the new formula:

          (IMPLIES (AND (NOT (EQUAL N X))
			(LESSP (COUNT (DELETE N Z)) (COUNT Z))
			(MEMBER N Z))
		   (LESSP (PLUS (COUNT X) (COUNT (DELETE N Z)))
			  (SUB1 (COUNT (CONS X Z))))).

    This further simplifies, rewriting with COUNT-CONS, SUB1-ADD1,
    and LESSP-PLUS-CANCELATION, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 5.3609212 0.39807943 ]

LESSP-COUNT-DELETE 


(DEFN PERM
      (A B)
      (IF (NLISTP A)
	  (NLISTP B)
	  (IF (MEMBER (CAR A) B)
	      (PERM (CDR A) (DELETE (CAR A) B))
	      F)))
     Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT A) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, PERM is accepted under the principle of definition.  The
definition of PERM can be justified in another way.  Linear
arithmetic and the lemma LESSP-COUNT-DELETE establish that the
measure (COUNT B) decreases according to the well-founded relation
LESSP in each recursive call.  Note that:
      (OR (FALSEP (PERM A B))
	  (TRUEP (PERM A B)))
is a theorem.




[ 0.77000325 0.079003906 ]

PERM 


(PROVE-LEMMA REMAINDER-TIMES
	     (REWRITE)
	     (EQUAL (REMAINDER (TIMES Y X) Y) 0.))
This conjecture simplifies, applying COMMUTATIVITY-OF-TIMES and
DIVIDES-TIMES, and unfolding the function EQUAL, to:

      T.

Q.E.D.


[ 0.128011068 0.0219889323 ]

REMAINDER-TIMES 


(PROVE-LEMMA PRIME-LIST-DELETE
	     (REWRITE)
	     (IMPLIES (PRIME-LIST L2)
		      (PRIME-LIST (DELETE X L2))))

     Name the conjecture *1.


     We will try to prove it by induction.  There are two plausible
inductions.  However, they merge into one likely candidate induction.
We will induct according to the following scheme:
      (AND (IMPLIES (NLISTP L2) (P X L2))
	   (IMPLIES (AND (NOT (NLISTP L2)) (P X (CDR L2)))
		    (P X L2))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT L2) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme generates the following
three new formulas:

Case 3. (IMPLIES (AND (NLISTP L2) (PRIME-LIST L2))
		 (PRIME-LIST (DELETE X L2))),

  which simplifies, applying DELETE-NON-MEMBER, and expanding the
  definitions of NLISTP, PRIME-LIST, and MEMBER, to:

        T.

Case 2. (IMPLIES (AND (NOT (NLISTP L2))
		      (NOT (PRIME-LIST (CDR L2)))
		      (PRIME-LIST L2))
		 (PRIME-LIST (DELETE X L2))),

  which simplifies, unfolding the functions NLISTP, PRIME-LIST, and
  PRIME, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP L2))
		      (PRIME-LIST (DELETE X (CDR L2)))
		      (PRIME-LIST L2))
		 (PRIME-LIST (DELETE X L2))).

  This simplifies, opening up the functions NLISTP, PRIME-LIST, PRIME,
  and DELETE, to the new conjecture:

        (IMPLIES (AND (LISTP L2)
		      (PRIME-LIST (DELETE X (CDR L2)))
		      (NOT (EQUAL (CAR L2) 0))
		      (NUMBERP (CAR L2))
		      (NOT (EQUAL (CAR L2) 1))
		      (PRIME1 (CAR L2) (SUB1 (CAR L2)))
		      (PRIME-LIST (CDR L2))
		      (NOT (EQUAL X (CAR L2))))
		 (PRIME-LIST (CONS (CAR L2) (DELETE X (CDR L2))))),

  which we again simplify, rewriting with CDR-CONS and CAR-CONS, and
  opening up PRIME and PRIME-LIST, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 12.187028 0.254980467 ]

PRIME-LIST-DELETE 


(PROVE-LEMMA DIVIDES-TIMES-LIST
	     (REWRITE)
	     (IMPLIES (AND (NOT (ZEROP C)) (MEMBER C L))
		      (EQUAL (REMAINDER (TIMES-LIST L) C)
			     0.)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT,
AND, and IMPLIES, to:

      (IMPLIES (AND (NOT (EQUAL C 0))
		    (NUMBERP C)
		    (MEMBER C L))
	       (EQUAL (REMAINDER (TIMES-LIST L) C)
		      0)).

Give the above formula the name *1.


     Let us appeal to the induction principle.  The recursive terms
in the conjecture suggest two inductions.  However, they merge into
one likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (NLISTP L) (P L C))
	   (IMPLIES (AND (NOT (NLISTP L))
			 (EQUAL C (CAR L)))
		    (P L C))
	   (IMPLIES (AND (NOT (NLISTP L))
			 (NOT (EQUAL C (CAR L)))
			 (P (CDR L) C))
		    (P L C))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP can be used to show that the measure (COUNT L)
decreases according to the well-founded relation LESSP in each
induction step of the scheme.  The above induction scheme produces
four new conjectures:

Case 4. (IMPLIES (AND (NLISTP L)
		      (NOT (EQUAL C 0))
		      (NUMBERP C)
		      (MEMBER C L))
		 (EQUAL (REMAINDER (TIMES-LIST L) C)
			0)),

  which we simplify, unfolding NLISTP and MEMBER, to:

        T.

Case 3. (IMPLIES (AND (NOT (NLISTP L))
		      (EQUAL C (CAR L))
		      (NOT (EQUAL C 0))
		      (NUMBERP C)
		      (MEMBER C L))
		 (EQUAL (REMAINDER (TIMES-LIST L) C)
			0)),

  which simplifies, rewriting with REMAINDER-TIMES, and opening up
  the functions NLISTP, MEMBER, TIMES-LIST, and EQUAL, to:

        T.

Case 2. (IMPLIES (AND (NOT (NLISTP L))
		      (NOT (EQUAL C (CAR L)))
		      (NOT (MEMBER C (CDR L)))
		      (NOT (EQUAL C 0))
		      (NUMBERP C)
		      (MEMBER C L))
		 (EQUAL (REMAINDER (TIMES-LIST L) C)
			0)).

  This simplifies, expanding NLISTP and MEMBER, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP L))
		      (NOT (EQUAL C (CAR L)))
		      (EQUAL (REMAINDER (TIMES-LIST (CDR L)) C)
			     0)
		      (NOT (EQUAL C 0))
		      (NUMBERP C)
		      (MEMBER C L))
		 (EQUAL (REMAINDER (TIMES-LIST L) C)
			0)),

  which we simplify, opening up NLISTP, MEMBER, and TIMES-LIST, to:

        (IMPLIES
		(AND (LISTP L)
		     (NOT (EQUAL C (CAR L)))
		     (EQUAL (REMAINDER (TIMES-LIST (CDR L)) C)
			    0)
		     (NOT (EQUAL C 0))
		     (NUMBERP C)
		     (MEMBER C (CDR L)))
		(EQUAL (REMAINDER (TIMES (CAR L) (TIMES-LIST (CDR L)))
				  C)
		       0)).

  Appealing to the lemma CAR-CDR-ELIM, we now replace L by (CONS X Z)
  to eliminate (CAR L) and (CDR L).  We would thus like to prove the
  new formula:

        (IMPLIES (AND (NOT (EQUAL C X))
		      (EQUAL (REMAINDER (TIMES-LIST Z) C)
			     0)
		      (NOT (EQUAL C 0))
		      (NUMBERP C)
		      (MEMBER C Z))
		 (EQUAL (REMAINDER (TIMES X (TIMES-LIST Z)) C)
			0)).

  We will try to prove the above formula by generalizing it,
  replacing (TIMES-LIST Z) by Y.  We restrict the new variable by
  recalling the type restriction lemma noted when TIMES-LIST was
  introduced.  This produces:

        (IMPLIES (AND (NUMBERP Y)
		      (NOT (EQUAL C X))
		      (EQUAL (REMAINDER Y C) 0)
		      (NOT (EQUAL C 0))
		      (NUMBERP C)
		      (MEMBER C Z))
		 (EQUAL (REMAINDER (TIMES X Y) C) 0)).

  Appealing to the lemma REMAINDER-QUOTIENT-ELIM, replace Y by
  (PLUS V (TIMES C W)) to eliminate (REMAINDER Y C) and
  (QUOTIENT Y C).  We employ LESSP-REMAINDER2, the type restriction
  lemma noted when REMAINDER was introduced, and the type restriction
  lemma noted when QUOTIENT was introduced to restrict the new
  variables.  We thus obtain:

        (IMPLIES (AND (NUMBERP V)
		      (EQUAL (LESSP V C) (NOT (ZEROP C)))
		      (NUMBERP W)
		      (NOT (EQUAL C X))
		      (EQUAL V 0)
		      (NOT (EQUAL C 0))
		      (NUMBERP C)
		      (MEMBER C Z))
		 (EQUAL (REMAINDER (TIMES X (PLUS V (TIMES C W)))
				   C)
			0)).

  This simplifies further, applying COMMUTATIVITY-OF-TIMES,
  COMMUTATIVITY2-OF-TIMES, and REMAINDER-TIMES, and unfolding NUMBERP,
  EQUAL, LESSP, ZEROP, NOT, and PLUS, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 68.633985 0.52101237 ]

DIVIDES-TIMES-LIST 


(PROVE-LEMMA QUOTIENT-TIMES
	     (REWRITE)
	     (EQUAL (QUOTIENT (TIMES Y X) Y)
		    (IF (ZEROP Y) 0. (FIX X))))
This simplifies, applying the lemma COMMUTATIVITY-OF-TIMES, and
expanding the definitions of ZEROP and FIX, to four new goals:

Case 4. (IMPLIES (EQUAL Y 0)
		 (EQUAL (QUOTIENT (TIMES X Y) Y) 0)),

  which we again simplify, rewriting with COMMUTATIVITY-OF-TIMES, and
  unfolding the definitions of EQUAL, TIMES, and QUOTIENT, to:

        T.

Case 3. (IMPLIES (NOT (NUMBERP Y))
		 (EQUAL (QUOTIENT (TIMES X Y) Y) 0)).

  This simplifies again, applying TIMES-ZERO2, and opening up
  QUOTIENT and EQUAL, to:

        T.

Case 2. (IMPLIES (NOT (NUMBERP X))
		 (EQUAL (QUOTIENT (TIMES X Y) Y) 0)),

  which we again simplify, unfolding TIMES, LESSP, EQUAL, and
  QUOTIENT, to:

        T.

Case 1. (IMPLIES (AND (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NUMBERP X))
		 (EQUAL (QUOTIENT (TIMES X Y) Y) X)).

  Give the above formula the name *1.


     We will appeal to induction.  There is only one plausible
induction.  We will induct according to the following scheme:
      (AND (IMPLIES (ZEROP X) (P X Y))
	   (IMPLIES (AND (NOT (ZEROP X)) (P (SUB1 X) Y))
		    (P X Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP establish that the measure (COUNT X) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme leads to two new formulas:

Case 2. (IMPLIES (AND (ZEROP X)
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NUMBERP X))
		 (EQUAL (QUOTIENT (TIMES X Y) Y) X)),

  which we simplify, expanding the definitions of ZEROP, NUMBERP,
  EQUAL, TIMES, LESSP, and QUOTIENT, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP X))
		      (EQUAL (QUOTIENT (TIMES (SUB1 X) Y) Y)
			     (SUB1 X))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NUMBERP X))
		 (EQUAL (QUOTIENT (TIMES X Y) Y) X)),

  which we simplify, rewriting with the lemmas ADD1-SUB1 and
  DIFFERENCE-PLUS1, and unfolding ZEROP, TIMES, and QUOTIENT, to:

        (IMPLIES (AND (NOT (EQUAL X 0))
		      (EQUAL (QUOTIENT (TIMES (SUB1 X) Y) Y)
			     (SUB1 X))
		      (NOT (EQUAL Y 0))
		      (NUMBERP Y)
		      (NUMBERP X))
		 ( LEQ Y (PLUS Y (TIMES (SUB1 X) Y)))).

  However this simplifies again, using linear arithmetic, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 2.51798502 0.32200521 ]

QUOTIENT-TIMES 


(PROVE-LEMMA DISTRIBUTIVITY-OF-DIVIDES
	     (REWRITE)
	     (IMPLIES (AND (NOT (ZEROP A)) (DIVIDES A W))
		      (EQUAL (TIMES C (QUOTIENT W A))
			     (QUOTIENT (TIMES C W) A))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT,
AND, IMPLIES, and DIVIDES, to the new conjecture:

      (IMPLIES (AND (NOT (EQUAL A 0))
		    (NUMBERP A)
		    (EQUAL (REMAINDER W A) 0))
	       (EQUAL (TIMES C (QUOTIENT W A))
		      (QUOTIENT (TIMES C W) A))).

Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace W by
(PLUS X (TIMES A Z)) to eliminate (REMAINDER W A) and (QUOTIENT W A).
We use LESSP-REMAINDER2, the type restriction lemma noted when
REMAINDER was introduced, and the type restriction lemma noted when
QUOTIENT was introduced to constrain the new variables.  We would
thus like to prove the following two new formulas:

Case 2. (IMPLIES (AND (NOT (NUMBERP W))
		      (NOT (EQUAL A 0))
		      (NUMBERP A)
		      (EQUAL (REMAINDER W A) 0))
		 (EQUAL (TIMES C (QUOTIENT W A))
			(QUOTIENT (TIMES C W) A))),

  which simplifies, applying COMMUTATIVITY-OF-TIMES and TIMES-ZERO2,
  and expanding the definitions of LESSP, REMAINDER, EQUAL, QUOTIENT,
  and TIMES, to:

        T.

Case 1. (IMPLIES (AND (NUMBERP X)
		      (EQUAL (LESSP X A) (NOT (ZEROP A)))
		      (NUMBERP Z)
		      (NOT (EQUAL A 0))
		      (NUMBERP A)
		      (EQUAL X 0))
		 (EQUAL (TIMES C Z)
			(QUOTIENT (TIMES C (PLUS X (TIMES A Z)))
				  A))),

  which simplifies, rewriting with COMMUTATIVITY2-OF-TIMES and
  QUOTIENT-TIMES, and opening up NUMBERP, EQUAL, LESSP, ZEROP, NOT,
  and PLUS, to:

        T.

Q.E.D.


[ 4.2470215 0.170979818 ]

DISTRIBUTIVITY-OF-DIVIDES 


(PROVE-LEMMA TIMES-LIST-DELETE
	     (REWRITE)
	     (IMPLIES (AND (NOT (ZEROP C)) (MEMBER C L))
		      (EQUAL (TIMES-LIST (DELETE C L))
			     (QUOTIENT (TIMES-LIST L) C))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT,
AND, and IMPLIES, to:

      (IMPLIES (AND (NOT (EQUAL C 0))
		    (NUMBERP C)
		    (MEMBER C L))
	       (EQUAL (TIMES-LIST (DELETE C L))
		      (QUOTIENT (TIMES-LIST L) C))).

Give the above formula the name *1.


     We will try to prove it by induction.  Three inductions are
suggested by terms in the conjecture.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (NLISTP L) (P C L))
	   (IMPLIES (AND (NOT (NLISTP L))
			 (EQUAL C (CAR L)))
		    (P C L))
	   (IMPLIES (AND (NOT (NLISTP L))
			 (NOT (EQUAL C (CAR L)))
			 (P C (CDR L)))
		    (P C L))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP establish that the measure (COUNT L) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme leads to the following
four new goals:

Case 4. (IMPLIES (AND (NLISTP L)
		      (NOT (EQUAL C 0))
		      (NUMBERP C)
		      (MEMBER C L))
		 (EQUAL (TIMES-LIST (DELETE C L))
			(QUOTIENT (TIMES-LIST L) C))),

  which simplifies, unfolding the definitions of NLISTP and MEMBER,
  to:

        T.

Case 3. (IMPLIES (AND (NOT (NLISTP L))
		      (EQUAL C (CAR L))
		      (NOT (EQUAL C 0))
		      (NUMBERP C)
		      (MEMBER C L))
		 (EQUAL (TIMES-LIST (DELETE C L))
			(QUOTIENT (TIMES-LIST L) C))).

  This simplifies, applying QUOTIENT-TIMES, and expanding the
  functions NLISTP, MEMBER, DELETE, and TIMES-LIST, to:

        T.

Case 2. (IMPLIES (AND (NOT (NLISTP L))
		      (NOT (EQUAL C (CAR L)))
		      (NOT (MEMBER C (CDR L)))
		      (NOT (EQUAL C 0))
		      (NUMBERP C)
		      (MEMBER C L))
		 (EQUAL (TIMES-LIST (DELETE C L))
			(QUOTIENT (TIMES-LIST L) C))).

  This simplifies, opening up NLISTP and MEMBER, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP L))
		      (NOT (EQUAL C (CAR L)))
		      (EQUAL (TIMES-LIST (DELETE C (CDR L)))
			     (QUOTIENT (TIMES-LIST (CDR L)) C))
		      (NOT (EQUAL C 0))
		      (NUMBERP C)
		      (MEMBER C L))
		 (EQUAL (TIMES-LIST (DELETE C L))
			(QUOTIENT (TIMES-LIST L) C))),

  which simplifies, appealing to the lemmas DISTRIBUTIVITY-OF-DIVIDES,
  DIVIDES-TIMES-LIST, CDR-CONS, and CAR-CONS, and unfolding the
  definitions of NLISTP, MEMBER, DELETE, EQUAL, DIVIDES, and
  TIMES-LIST, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 2.96100262 0.30799154 ]

TIMES-LIST-DELETE 


(PROVE-LEMMA PRIME-LIST-TIMES-LIST
	     (REWRITE)
	     (IMPLIES (AND (PRIME C)
			   (PRIME-LIST L2)
			   (NOT (MEMBER C L2)))
		      (NOT (EQUAL (REMAINDER (TIMES-LIST L2) C)
				  0.))))
This conjecture can be simplified, using the abbreviations NOT, PRIME,
AND, and IMPLIES, to:

      (IMPLIES (AND (NOT (EQUAL C 0))
		    (NUMBERP C)
		    (NOT (EQUAL C 1))
		    (PRIME1 C (SUB1 C))
		    (PRIME-LIST L2)
		    (NOT (MEMBER C L2)))
	       (NOT (EQUAL (REMAINDER (TIMES-LIST L2) C)
			   0))).

Appealing to the lemma SUB1-ELIM, replace C by (ADD1 X) to eliminate
(SUB1 C).  We rely upon the type restriction lemma noted when SUB1
was introduced to constrain the new variable.  The result is:

      (IMPLIES (AND (NUMBERP X)
		    (NOT (EQUAL (ADD1 X) 0))
		    (NOT (EQUAL (ADD1 X) 1))
		    (PRIME1 (ADD1 X) X)
		    (PRIME-LIST L2)
		    (NOT (MEMBER (ADD1 X) L2)))
	       (NOT (EQUAL (REMAINDER (TIMES-LIST L2) (ADD1 X))
			   0))).

But this simplifies, rewriting with ADD1-EQUAL, and unfolding the
definition of NUMBERP, to the new conjecture:

      (IMPLIES (AND (NUMBERP X)
		    (NOT (EQUAL X 0))
		    (PRIME1 (ADD1 X) X)
		    (PRIME-LIST L2)
		    (NOT (MEMBER (ADD1 X) L2)))
	       (NOT (EQUAL (REMAINDER (TIMES-LIST L2) (ADD1 X))
			   0))),

which we would normally push and work on later by induction.  But if
we must use induction to prove the input conjecture, we prefer to
induct on the original formulation of the problem.  Thus we will
disregard all that we have previously done, give the name *1 to the
original input, and work on it.


     So now let us consider:

(IMPLIES (AND (PRIME C)
	      (PRIME-LIST L2)
	      (NOT (MEMBER C L2)))
	 (NOT (EQUAL (REMAINDER (TIMES-LIST L2) C)
		     0))),

which we named *1 above.  We will try to prove it by induction.  The
recursive terms in the conjecture suggest three inductions.  However,
they merge into one likely candidate induction.  We will induct
according to the following scheme:
      (AND (IMPLIES (NLISTP L2) (P L2 C))
	   (IMPLIES (AND (NOT (NLISTP L2))
			 (EQUAL C (CAR L2)))
		    (P L2 C))
	   (IMPLIES (AND (NOT (NLISTP L2))
			 (NOT (EQUAL C (CAR L2)))
			 (P (CDR L2) C))
		    (P L2 C))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP can be used to prove that the measure (COUNT L2)
decreases according to the well-founded relation LESSP in each
induction step of the scheme.  The above induction scheme produces
the following five new formulas:

Case 5. (IMPLIES (AND (NLISTP L2)
		      (PRIME C)
		      (PRIME-LIST L2)
		      (NOT (MEMBER C L2)))
		 (NOT (EQUAL (REMAINDER (TIMES-LIST L2) C)
			     0))).

  This simplifies, applying REMAINDER-0-CROCK and DIFFERENCE-0, and
  unfolding the functions NLISTP, PRIME, PRIME-LIST, MEMBER,
  TIMES-LIST, DIFFERENCE, EQUAL, SUB1, LESSP, NUMBERP, and REMAINDER,
  to:

        (IMPLIES (AND (NOT (LISTP L2))
		      (NOT (EQUAL C 0))
		      (NUMBERP C)
		      (NOT (EQUAL C 1))
		      (PRIME1 C (SUB1 C)))
		 (LESSP 1 C)),

  which again simplifies, using linear arithmetic, to:

        T.

Case 4. (IMPLIES (AND (NOT (NLISTP L2))
		      (EQUAL C (CAR L2))
		      (PRIME C)
		      (PRIME-LIST L2)
		      (NOT (MEMBER C L2)))
		 (NOT (EQUAL (REMAINDER (TIMES-LIST L2) C)
			     0))),

  which we simplify, opening up NLISTP, PRIME, PRIME-LIST, and MEMBER,
  to:

        T.

Case 3. (IMPLIES (AND (NOT (NLISTP L2))
		      (NOT (EQUAL C (CAR L2)))
		      (NOT (PRIME-LIST (CDR L2)))
		      (PRIME C)
		      (PRIME-LIST L2)
		      (NOT (MEMBER C L2)))
		 (NOT (EQUAL (REMAINDER (TIMES-LIST L2) C)
			     0))),

  which simplifies, expanding the definitions of NLISTP, PRIME, and
  PRIME-LIST, to:

        T.

Case 2. (IMPLIES (AND (NOT (NLISTP L2))
		      (NOT (EQUAL C (CAR L2)))
		      (MEMBER C (CDR L2))
		      (PRIME C)
		      (PRIME-LIST L2)
		      (NOT (MEMBER C L2)))
		 (NOT (EQUAL (REMAINDER (TIMES-LIST L2) C)
			     0))),

  which we simplify, expanding the functions NLISTP, PRIME,
  PRIME-LIST, and MEMBER, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP L2))
		      (NOT (EQUAL C (CAR L2)))
		      (NOT (EQUAL (REMAINDER (TIMES-LIST (CDR L2)) C)
				  0))
		      (PRIME C)
		      (PRIME-LIST L2)
		      (NOT (MEMBER C L2)))
		 (NOT (EQUAL (REMAINDER (TIMES-LIST L2) C)
			     0))),

  which simplifies, using linear arithmetic, rewriting with the
  lemmas PRIME-KEY, LITTLE-STEP, and QUOTIENT-DIVIDES, and unfolding
  the definitions of NLISTP, PRIME, PRIME-LIST, MEMBER, TIMES-LIST,
  and DIVIDES, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 68.387028 1.40997721 ]

PRIME-LIST-TIMES-LIST 


(PROVE-LEMMA IF-TIMES-THEN-DIVIDES
	     (REWRITE)
	     (IMPLIES (AND (NOT (ZEROP C))
			   (NOT (DIVIDES C X)))
		      (NOT (EQUAL (TIMES C Y) X))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT,
AND, IMPLIES, and DIVIDES, to the goal:

      (IMPLIES (AND (NOT (EQUAL C 0))
		    (NUMBERP C)
		    (NOT (EQUAL (REMAINDER X C) 0)))
	       (NOT (EQUAL (TIMES C Y) X))),

which simplifies, applying the lemma REMAINDER-TIMES, and expanding
the definition of EQUAL, to:

      T.

Q.E.D.


[ 0.236995442 0.05 ]

IF-TIMES-THEN-DIVIDES 


(PROVE-LEMMA TIMES-EQUAL-1
	     (REWRITE)
	     (EQUAL (EQUAL (TIMES A B) 1.)
		    (AND (NOT (EQUAL A 0.))
			 (NOT (EQUAL B 0.))
			 (NUMBERP A)
			 (NUMBERP B)
			 (EQUAL (SUB1 A) 0.)
			 (EQUAL (SUB1 B) 0.))))
This formula simplifies, applying COMMUTATIVITY-OF-TIMES, and
expanding the definitions of TIMES, NOT, and AND, to five new goals:

Case 5. (IMPLIES (AND (NOT (EQUAL A 0))
		      (NUMBERP A)
		      (NOT (EQUAL B 0))
		      (NUMBERP B)
		      (EQUAL (PLUS B
				   (PLUS (SUB1 A)
					 (TIMES (SUB1 A) (SUB1 B))))
			     1))
		 (EQUAL (EQUAL (SUB1 B) 0) T)),

  which we again simplify, using linear arithmetic, to:

        (IMPLIES (AND (NOT (EQUAL 1 0))
		      (NUMBERP 1)
		      (NOT (EQUAL B 0))
		      (NUMBERP B)
		      (EQUAL (PLUS B
				   (PLUS (SUB1 1)
					 (TIMES (SUB1 1) (SUB1 B))))
			     1))
		 (EQUAL (EQUAL (SUB1 B) 0) T)).

  This again simplifies, applying COMMUTATIVITY-OF-PLUS, and
  expanding the definitions of EQUAL, NUMBERP, SUB1, TIMES, and PLUS,
  to:

        T.

Case 4. (IMPLIES
	      (AND (NOT (EQUAL A 0))
		   (NUMBERP A)
		   (NOT (EQUAL B 0))
		   (NUMBERP B)
		   (NOT (EQUAL (PLUS B
				     (PLUS (SUB1 A)
					   (TIMES (SUB1 A) (SUB1 B))))
			       1))
		   (EQUAL (SUB1 A) 0))
	      (NOT (EQUAL (SUB1 B) 0))),

  which again simplifies, using linear arithmetic, to:

        T.

Case 3. (IMPLIES (AND (NOT (EQUAL A 0))
		      (NUMBERP A)
		      (EQUAL B 0))
		 (NOT (EQUAL (PLUS B 0) 1))),

  which we again simplify, using linear arithmetic, to:

        T.

Case 2. (IMPLIES (AND (NOT (EQUAL A 0))
		      (NUMBERP A)
		      (NOT (NUMBERP B)))
		 (NOT (EQUAL (PLUS B 0) 1))).

  However this again simplifies, appealing to the lemmas
  PLUS-RIGHT-ID2 and COMMUTATIVITY-OF-PLUS, and unfolding the
  definitions of NUMBERP and EQUAL, to:

        T.

Case 1. (IMPLIES (AND (NOT (EQUAL A 0))
		      (NUMBERP A)
		      (NOT (EQUAL B 0))
		      (NUMBERP B)
		      (EQUAL (PLUS B
				   (PLUS (SUB1 A)
					 (TIMES (SUB1 A) (SUB1 B))))
			     1))
		 (EQUAL (SUB1 A) 0)),

  which we again simplify, using linear arithmetic, to:

        T.

Q.E.D.


[ 2.35704753 0.225960286 ]

TIMES-EQUAL-1 


(PROVE-LEMMA PRIME-MEMBER
	     (REWRITE)
	     (IMPLIES (AND (EQUAL (TIMES C (TIMES-LIST L1))
				  (TIMES-LIST L2))
			   (PRIME C)
			   (PRIME-LIST L2))
		      (MEMBER C L2))
	     ((DISABLE TIMES)))

WARNING:  Note that PRIME-MEMBER contains the free variable L1 which
will be chosen by instantiating the hypothesis:
      (EQUAL (TIMES C (TIMES-LIST L1))
	     (TIMES-LIST L2))
.

This formula can be simplified, using the abbreviations PRIME, AND,
and IMPLIES, to:

      (IMPLIES (AND (EQUAL (TIMES C (TIMES-LIST L1))
			   (TIMES-LIST L2))
		    (NOT (EQUAL C 0))
		    (NUMBERP C)
		    (NOT (EQUAL C 1))
		    (PRIME1 C (SUB1 C))
		    (PRIME-LIST L2))
	       (MEMBER C L2)).

This simplifies, rewriting with PRIME-LIST-TIMES-LIST and
IF-TIMES-THEN-DIVIDES, and opening up the definitions of DIVIDES and
PRIME, to:

      T.

Q.E.D.


[ 0.73902995 0.0559895835 ]

PRIME-MEMBER 


(PROVE-LEMMA DIVIDES-IMPLIES-TIMES
	     (REWRITE)
	     (IMPLIES (AND (NOT (ZEROP A))
			   (NUMBERP C)
			   (EQUAL (TIMES A C) B))
		      (EQUAL (EQUAL C (QUOTIENT B A)) T)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT,
AND, and IMPLIES, to the new conjecture:

      (IMPLIES (AND (NOT (EQUAL A 0))
		    (NUMBERP A)
		    (NUMBERP C)
		    (EQUAL (TIMES A C) B))
	       (EQUAL (EQUAL C (QUOTIENT B A)) T)).

This simplifies, appealing to the lemma QUOTIENT-TIMES, and expanding
EQUAL, to:

      T.

Q.E.D.


[ 0.269970704 0.050032552 ]

DIVIDES-IMPLIES-TIMES 


(PROVE-LEMMA PRIME-FACTORIZATION-UNIQUENESS NIL
	     (IMPLIES (AND (PRIME-LIST L1)
			   (PRIME-LIST L2)
			   (EQUAL (TIMES-LIST L1)
				  (TIMES-LIST L2)))
		      (PERM L1 L2)))

     Name the conjecture *1.


     We will try to prove it by induction.  There are six plausible
inductions.  They merge into two likely candidate inductions, both of
which are unflawed.  So we will choose the one suggested by the
largest number of nonprimitive recursive functions.  We will induct
according to the following scheme:
      (AND (IMPLIES (NLISTP L1) (P L1 L2))
	   (IMPLIES (AND (NOT (NLISTP L1))
			 (MEMBER (CAR L1) L2)
			 (P (CDR L1) (DELETE (CAR L1) L2)))
		    (P L1 L2))
	   (IMPLIES (AND (NOT (NLISTP L1))
			 (NOT (MEMBER (CAR L1) L2)))
		    (P L1 L2))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT L1) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  Note, however, the inductive instance chosen for L2.
The above induction scheme generates the following six new formulas:

Case 6. (IMPLIES (AND (NLISTP L1)
		      (PRIME-LIST L1)
		      (PRIME-LIST L2)
		      (EQUAL (TIMES-LIST L1)
			     (TIMES-LIST L2)))
		 (PERM L1 L2)),

  which simplifies, expanding the definitions of NLISTP, PRIME-LIST,
  TIMES-LIST, and PERM, to:

        (IMPLIES (AND (NOT (LISTP L1))
		      (PRIME-LIST L2)
		      (EQUAL 1 (TIMES-LIST L2)))
		 (NOT (LISTP L2))),

  which has an irrelevant term in it.  By eliminating the term we get:

        (IMPLIES (AND (PRIME-LIST L2)
		      (EQUAL 1 (TIMES-LIST L2)))
		 (NOT (LISTP L2))),

  which we will name *1.1.

Case 5. (IMPLIES (AND (NOT (NLISTP L1))
		      (MEMBER (CAR L1) L2)
		      (NOT (PRIME-LIST (CDR L1)))
		      (PRIME-LIST L1)
		      (PRIME-LIST L2)
		      (EQUAL (TIMES-LIST L1)
			     (TIMES-LIST L2)))
		 (PERM L1 L2)),

  which simplifies, unfolding the functions NLISTP, PRIME-LIST, and
  PRIME, to:

        T.

Case 4. (IMPLIES (AND (NOT (NLISTP L1))
		      (MEMBER (CAR L1) L2)
		      (NOT (PRIME-LIST (DELETE (CAR L1) L2)))
		      (PRIME-LIST L1)
		      (PRIME-LIST L2)
		      (EQUAL (TIMES-LIST L1)
			     (TIMES-LIST L2)))
		 (PERM L1 L2)).

  This simplifies, rewriting with PRIME-LIST-DELETE, and expanding
  NLISTP, to:

        T.

Case 3. (IMPLIES (AND (NOT (NLISTP L1))
		      (MEMBER (CAR L1) L2)
		      (NOT (EQUAL (TIMES-LIST (CDR L1))
				  (TIMES-LIST (DELETE (CAR L1) L2))))
		      (PRIME-LIST L1)
		      (PRIME-LIST L2)
		      (EQUAL (TIMES-LIST L1)
			     (TIMES-LIST L2)))
		 (PERM L1 L2)),

  which we simplify, rewriting with the lemma PRIME-MEMBER, and
  expanding the definitions of NLISTP, PRIME-LIST, PRIME, TIMES-LIST,
  and PERM, to:

        (IMPLIES (AND (LISTP L1)
		      (MEMBER (CAR L1) L2)
		      (NOT (EQUAL (TIMES-LIST (CDR L1))
				  (TIMES-LIST (DELETE (CAR L1) L2))))
		      (NOT (EQUAL (CAR L1) 0))
		      (NUMBERP (CAR L1))
		      (NOT (EQUAL (CAR L1) 1))
		      (PRIME1 (CAR L1) (SUB1 (CAR L1)))
		      (PRIME-LIST (CDR L1))
		      (PRIME-LIST L2)
		      (EQUAL (TIMES (CAR L1) (TIMES-LIST (CDR L1)))
			     (TIMES-LIST L2)))
		 (PERM (CDR L1) (DELETE (CAR L1) L2))),

  which we again simplify, rewriting with PRIME-MEMBER,
  TIMES-LIST-DELETE, and DIVIDES-IMPLIES-TIMES, and unfolding PRIME,
  to:

        T.

Case 2. (IMPLIES (AND (NOT (NLISTP L1))
		      (MEMBER (CAR L1) L2)
		      (PERM (CDR L1) (DELETE (CAR L1) L2))
		      (PRIME-LIST L1)
		      (PRIME-LIST L2)
		      (EQUAL (TIMES-LIST L1)
			     (TIMES-LIST L2)))
		 (PERM L1 L2)),

  which simplifies, rewriting with PRIME-MEMBER, and expanding the
  definitions of NLISTP, PRIME-LIST, PRIME, TIMES-LIST, and PERM, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP L1))
		      (NOT (MEMBER (CAR L1) L2))
		      (PRIME-LIST L1)
		      (PRIME-LIST L2)
		      (EQUAL (TIMES-LIST L1)
			     (TIMES-LIST L2)))
		 (PERM L1 L2)).

  This simplifies, applying PRIME-LIST-TIMES-LIST and
  IF-TIMES-THEN-DIVIDES, and opening up NLISTP, PRIME-LIST, PRIME,
  TIMES-LIST, and DIVIDES, to:

        T.


     So we now return to:

      (IMPLIES (AND (PRIME-LIST L2)
		    (EQUAL 1 (TIMES-LIST L2)))
	       (NOT (LISTP L2))),

which we named *1.1 above.  Let us appeal to the induction principle.
Two inductions are suggested by terms in the conjecture.  However,
they merge into one likely candidate induction.  We will induct
according to the following scheme:
      (AND (IMPLIES (NLISTP L2) (P L2))
	   (IMPLIES (AND (NOT (NLISTP L2)) (P (CDR L2)))
		    (P L2))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP can be used to establish that the measure
(COUNT L2) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
produces the following four new conjectures:

Case 4. (IMPLIES (AND (NLISTP L2)
		      (PRIME-LIST L2)
		      (EQUAL 1 (TIMES-LIST L2)))
		 (NOT (LISTP L2))),

  which simplifies, unfolding the definition of NLISTP, to:

        T.

Case 3. (IMPLIES (AND (NOT (NLISTP L2))
		      (NOT (PRIME-LIST (CDR L2)))
		      (PRIME-LIST L2)
		      (EQUAL 1 (TIMES-LIST L2)))
		 (NOT (LISTP L2))),

  which simplifies, expanding the functions NLISTP, PRIME-LIST, and
  PRIME, to:

        T.

Case 2. (IMPLIES (AND (NOT (NLISTP L2))
		      (NOT (EQUAL 1 (TIMES-LIST (CDR L2))))
		      (PRIME-LIST L2)
		      (EQUAL 1 (TIMES-LIST L2)))
		 (NOT (LISTP L2))),

  which simplifies, applying TIMES-EQUAL-1, and opening up the
  functions NLISTP, PRIME-LIST, PRIME, and TIMES-LIST, to:

        (IMPLIES (AND (NOT (EQUAL 1 (TIMES-LIST (CDR L2))))
		      (NOT (EQUAL (CAR L2) 0))
		      (NUMBERP (CAR L2))
		      (NOT (EQUAL (CAR L2) 1))
		      (PRIME1 (CAR L2) (SUB1 (CAR L2)))
		      (PRIME-LIST (CDR L2))
		      (NOT (EQUAL 0 (TIMES-LIST (CDR L2))))
		      (EQUAL 0 (SUB1 (CAR L2)))
		      (EQUAL 0
			     (SUB1 (TIMES-LIST (CDR L2)))))
		 (NOT (LISTP L2))),

  which we again simplify, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP L2))
		      (NOT (LISTP (CDR L2)))
		      (PRIME-LIST L2)
		      (EQUAL 1 (TIMES-LIST L2)))
		 (NOT (LISTP L2))),

  which we simplify, applying TIMES-EQUAL-1, and opening up the
  functions NLISTP, PRIME-LIST, PRIME, and TIMES-LIST, to:

        (IMPLIES (AND (NOT (LISTP (CDR L2)))
		      (NOT (EQUAL (CAR L2) 0))
		      (NUMBERP (CAR L2))
		      (NOT (EQUAL (CAR L2) 1))
		      (PRIME1 (CAR L2) (SUB1 (CAR L2)))
		      (PRIME-LIST (CDR L2))
		      (NOT (EQUAL 0 (TIMES-LIST (CDR L2))))
		      (EQUAL 0 (SUB1 (CAR L2)))
		      (EQUAL 0
			     (SUB1 (TIMES-LIST (CDR L2)))))
		 (NOT (LISTP L2))),

  which we again simplify, using linear arithmetic, to:

        T.


     That finishes the proof of *1.1, which, consequently, also
finishes the proof of *1.  Q.E.D.


[ 35.284017 0.7839681 ]

PRIME-FACTORIZATION-UNIQUENESS 


(DEFN MAXIMUM
      (L)
      (IF (NLISTP L)
	  0.
	  (IF (LESSP (CAR L) (MAXIMUM (CDR L)))
	      (MAXIMUM (CDR L))
	      (CAR L))))
     Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP establish that the measure (COUNT L) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, MAXIMUM is accepted under the definitional principle.




[ 0.89099935 0.0379882813 ]

MAXIMUM 


(PROVE-LEMMA MEMBER-MAXIMUM
	     (REWRITE)
	     (IMPLIES (LISTP X)
		      (MEMBER (MAXIMUM X) X)))

     Name the conjecture *1.


     We will try to prove it by induction.  There are two plausible
inductions.  However, they merge into one likely candidate induction.
We will induct according to the following scheme:
      (AND (IMPLIES (NLISTP X) (P X))
	   (IMPLIES (AND (NOT (NLISTP X))
			 (EQUAL (MAXIMUM X) (CAR X)))
		    (P X))
	   (IMPLIES (AND (NOT (NLISTP X))
			 (NOT (EQUAL (MAXIMUM X) (CAR X)))
			 (P (CDR X)))
		    (P X))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme generates the following
four new formulas:

Case 4. (IMPLIES (AND (NLISTP X) (LISTP X))
		 (MEMBER (MAXIMUM X) X)),

  which simplifies, expanding the definition of NLISTP, to:

        T.

Case 3. (IMPLIES (AND (NOT (NLISTP X))
		      (EQUAL (MAXIMUM X) (CAR X))
		      (LISTP X))
		 (MEMBER (MAXIMUM X) X)),

  which we simplify, unfolding NLISTP, MAXIMUM, and MEMBER, to:

        T.

Case 2. (IMPLIES (AND (NOT (NLISTP X))
		      (NOT (EQUAL (MAXIMUM X) (CAR X)))
		      (NOT (LISTP (CDR X)))
		      (LISTP X))
		 (MEMBER (MAXIMUM X) X)),

  which simplifies, unfolding the functions NLISTP and MAXIMUM, to
  the formula:

        (IMPLIES (AND (LESSP (CAR X) (MAXIMUM (CDR X)))
		      (NOT (EQUAL (MAXIMUM (CDR X)) (CAR X)))
		      (NOT (LISTP (CDR X)))
		      (LISTP X))
		 (MEMBER (MAXIMUM (CDR X)) X)).

  However this simplifies further, unfolding the functions MAXIMUM,
  EQUAL, and LESSP, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP X))
		      (NOT (EQUAL (MAXIMUM X) (CAR X)))
		      (MEMBER (MAXIMUM (CDR X)) (CDR X))
		      (LISTP X))
		 (MEMBER (MAXIMUM X) X)),

  which we simplify, expanding the definitions of NLISTP, MAXIMUM,
  and MEMBER, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.0500651 0.2609375 ]

MEMBER-MAXIMUM 


(PROVE-LEMMA LESSP-DELETE-REWRITE
	     (REWRITE)
	     (EQUAL (LESSP (COUNT (DELETE X L)) (COUNT L))
		    (MEMBER X L)))
This simplifies, rewriting with EQUAL-LESSP, to the following two new
conjectures:

Case 2. (IMPLIES ( LEQ (COUNT L) (COUNT (DELETE X L)))
		 (NOT (MEMBER X L))),

  which again simplifies, using linear arithmetic and rewriting with
  LESSP-COUNT-DELETE, to:

        T.

Case 1. (IMPLIES (LESSP (COUNT (DELETE X L)) (COUNT L))
		 (MEMBER X L)).

  But this simplifies again, rewriting with DELETE-NON-MEMBER, to:

        (IMPLIES (LESSP (COUNT L) (COUNT L))
		 (MEMBER X L)),

  which again simplifies, using linear arithmetic, to:

        T.

Q.E.D.


[ 0.66500651 0.1 ]

LESSP-DELETE-REWRITE 


(DEFN ORDERED2
      (L)
      (IF (LISTP L)
	  (IF (LISTP (CDR L))
	      (IF (LESSP (CAR L) (CADR L))
		  F
		  (ORDERED2 (CDR L)))
	      T)
	  T))
     Linear arithmetic and the lemma CDR-LESSP inform us that the
measure (COUNT L) decreases according to the well-founded relation
LESSP in each recursive call.  Hence, ORDERED2 is accepted under the
definitional principle.  Note that:
      (OR (FALSEP (ORDERED2 L))
	  (TRUEP (ORDERED2 L)))
is a theorem.




[ 0.109993489 0.043994141 ]

ORDERED2 


(DEFN DSORT
      (L)
      (IF (NLISTP L)
	  NIL
	  (CONS (MAXIMUM L)
		(DSORT (DELETE (MAXIMUM L) L)))))
     The lemmas LESSP-DELETE-REWRITE and MEMBER-MAXIMUM and the
definition of NLISTP inform us that the measure (COUNT L) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, DSORT is accepted under the definitional principle.  Note that:
      (OR (LITATOM (DSORT L))
	  (LISTP (DSORT L)))
is a theorem.




[ 0.35900065 0.0459960937 ]

DSORT 


(DEFN ADDTOLIST2
      (X L)
      (IF (LISTP L)
	  (IF (LESSP X (CAR L))
	      (CONS (CAR L) (ADDTOLIST2 X (CDR L)))
	      (CONS X L))
	  (CONS X NIL)))
     Linear arithmetic and the lemma CDR-LESSP can be used to
establish that the measure (COUNT L) decreases according to the
well-founded relation LESSP in each recursive call.  Hence,
ADDTOLIST2 is accepted under the definitional principle.  Observe
that (LISTP (ADDTOLIST2 X L)) is a theorem.




[ 0.10600586 0.0419921875 ]

ADDTOLIST2 


(DEFN SORT2
      (L)
      (IF (NLISTP L)
	  NIL
	  (ADDTOLIST2 (CAR L) (SORT2 (CDR L)))))
     Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP establish that the measure (COUNT L) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, SORT2 is accepted under the principle of definition.  Note
that (OR (LITATOM (SORT2 L)) (LISTP (SORT2 L))) is a theorem.




[ 1.25099283 0.045019531 ]

SORT2 


(PROVE-LEMMA SORT2-GEN-1
	     (REWRITE)
	     (PLISTP (SORT2 X)))

     Give the conjecture the name *1.


     Let us appeal to the induction principle.  There is only one
suggested induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (NLISTP X) (P X))
	   (IMPLIES (AND (NOT (NLISTP X)) (P (CDR X)))
		    (P X))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme generates two new
conjectures:

Case 2. (IMPLIES (NLISTP X)
		 (PLISTP (SORT2 X))),

  which simplifies, opening up the definitions of NLISTP, SORT2, and
  PLISTP, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP X))
		      (PLISTP (SORT2 (CDR X))))
		 (PLISTP (SORT2 X))).

  This simplifies, expanding the functions NLISTP and SORT2, to:

        (IMPLIES (AND (LISTP X)
		      (PLISTP (SORT2 (CDR X))))
		 (PLISTP (ADDTOLIST2 (CAR X)
				     (SORT2 (CDR X))))).

  Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS V Z) to
  eliminate (CDR X) and (CAR X).  We thus obtain:

        (IMPLIES (PLISTP (SORT2 Z))
		 (PLISTP (ADDTOLIST2 V (SORT2 Z)))),

  which we generalize by replacing (SORT2 Z) by Y.  We thus obtain:

        (IMPLIES (PLISTP Y)
		 (PLISTP (ADDTOLIST2 V Y))),

  which we will name *1.1.


     We will appeal to induction.  There are two plausible inductions.
However, they merge into one likely candidate induction.  We will
induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP Y)
			 (LESSP V (CAR Y))
			 (P V (CDR Y)))
		    (P V Y))
	   (IMPLIES (AND (LISTP Y) ( LEQ (CAR Y) V))
		    (P V Y))
	   (IMPLIES (NOT (LISTP Y)) (P V Y))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme leads
to the following four new formulas:

Case 4. (IMPLIES (AND (LISTP Y)
		      (LESSP V (CAR Y))
		      (NOT (PLISTP (CDR Y)))
		      (PLISTP Y))
		 (PLISTP (ADDTOLIST2 V Y))),

  which we simplify, opening up PLISTP, to:

        T.

Case 3. (IMPLIES (AND (LISTP Y)
		      (LESSP V (CAR Y))
		      (PLISTP (ADDTOLIST2 V (CDR Y)))
		      (PLISTP Y))
		 (PLISTP (ADDTOLIST2 V Y))),

  which simplifies, applying CDR-CONS, and expanding the functions
  PLISTP and ADDTOLIST2, to:

        T.

Case 2. (IMPLIES (AND (LISTP Y)
		      ( LEQ (CAR Y) V)
		      (PLISTP Y))
		 (PLISTP (ADDTOLIST2 V Y))),

  which we simplify, rewriting with CDR-CONS, and expanding the
  definitions of PLISTP and ADDTOLIST2, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP Y)) (PLISTP Y))
		 (PLISTP (ADDTOLIST2 V Y))),

  which we simplify, applying CDR-CONS, and opening up PLISTP, LISTP,
  and ADDTOLIST2, to:

        T.


     That finishes the proof of *1.1, which, consequently, also
finishes the proof of *1.  Q.E.D.


[ 1.91998698 0.411002602 ]

SORT2-GEN-1 


(PROVE-LEMMA SORT2-GEN-2
	     (REWRITE)
	     (ORDERED2 (SORT2 X)))

     Give the conjecture the name *1.


     Let us appeal to the induction principle.  There is only one
suggested induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (NLISTP X) (P X))
	   (IMPLIES (AND (NOT (NLISTP X)) (P (CDR X)))
		    (P X))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme generates two new
conjectures:

Case 2. (IMPLIES (NLISTP X)
		 (ORDERED2 (SORT2 X))),

  which simplifies, opening up the definitions of NLISTP, SORT2, and
  ORDERED2, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP X))
		      (ORDERED2 (SORT2 (CDR X))))
		 (ORDERED2 (SORT2 X))).

  This simplifies, expanding the functions NLISTP and SORT2, to:

        (IMPLIES (AND (LISTP X)
		      (ORDERED2 (SORT2 (CDR X))))
		 (ORDERED2 (ADDTOLIST2 (CAR X)
				       (SORT2 (CDR X))))).

  Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS V Z) to
  eliminate (CDR X) and (CAR X).  We thus obtain:

        (IMPLIES (ORDERED2 (SORT2 Z))
		 (ORDERED2 (ADDTOLIST2 V (SORT2 Z)))),

  which we generalize by replacing (SORT2 Z) by Y.  We thus obtain:

        (IMPLIES (ORDERED2 Y)
		 (ORDERED2 (ADDTOLIST2 V Y))),

  which we will name *1.1.


     We will appeal to induction.  There are two plausible inductions.
However, they merge into one likely candidate induction.  We will
induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP Y)
			 (LISTP (CDR Y))
			 (LESSP (CAR Y) (CADR Y)))
		    (P V Y))
	   (IMPLIES (AND (LISTP Y)
			 (LISTP (CDR Y))
			 ( LEQ (CADR Y) (CAR Y))
			 (P V (CDR Y)))
		    (P V Y))
	   (IMPLIES (AND (LISTP Y) (NOT (LISTP (CDR Y))))
		    (P V Y))
	   (IMPLIES (NOT (LISTP Y)) (P V Y))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme leads
to the following five new formulas:

Case 5. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      (LESSP (CAR Y) (CADR Y))
		      (ORDERED2 Y))
		 (ORDERED2 (ADDTOLIST2 V Y))),

  which we simplify, opening up ORDERED2, to:

        T.

Case 4. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CADR Y) (CAR Y))
		      (NOT (ORDERED2 (CDR Y)))
		      (ORDERED2 Y))
		 (ORDERED2 (ADDTOLIST2 V Y))),

  which simplifies, expanding the definition of ORDERED2, to:

        T.

Case 3. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CADR Y) (CAR Y))
		      (ORDERED2 (ADDTOLIST2 V (CDR Y)))
		      (ORDERED2 Y))
		 (ORDERED2 (ADDTOLIST2 V Y))),

  which we simplify, unfolding ORDERED2 and ADDTOLIST2, to two new
  conjectures:

  Case 3.2.
          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CADR Y) (CAR Y))
			(ORDERED2 (ADDTOLIST2 V (CDR Y)))
			(ORDERED2 (CDR Y))
			( LEQ (CAR Y) V))
		   (ORDERED2 (CONS V Y))),

    which we again simplify, applying CAR-CONS and CDR-CONS, and
    opening up ORDERED2, to:

          T.

  Case 3.1.
          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CADR Y) (CAR Y))
			(ORDERED2 (ADDTOLIST2 V (CDR Y)))
			(ORDERED2 (CDR Y))
			(LESSP V (CAR Y)))
		   (ORDERED2 (CONS (CAR Y)
				   (ADDTOLIST2 V (CDR Y))))).

    But this simplifies again, rewriting with CAR-CONS and CDR-CONS,
    and expanding the function ORDERED2, to:

          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CADR Y) (CAR Y))
			(ORDERED2 (ADDTOLIST2 V (CDR Y)))
			(ORDERED2 (CDR Y))
			(LESSP V (CAR Y)))
		   ( LEQ
		     (CAR (ADDTOLIST2 V (CDR Y)))
		     (CAR Y))).

    Applying the lemma CAR-CDR-ELIM, we now replace Y by (CONS Z X)
    to eliminate (CDR Y) and (CAR Y) and X by (CONS W D) to eliminate
    (CAR X) and (CDR X).  We thus obtain:

          (IMPLIES (AND ( LEQ W Z)
			(ORDERED2 (ADDTOLIST2 V (CONS W D)))
			(ORDERED2 (CONS W D))
			(LESSP V Z))
		   ( LEQ
		     (CAR (ADDTOLIST2 V (CONS W D)))
		     Z)),

    which we further simplify, rewriting with the lemmas CDR-CONS and
    CAR-CONS, and expanding the definitions of ADDTOLIST2 and
    ORDERED2, to the following two new conjectures:

    Case 3.1.2.
            (IMPLIES (AND ( LEQ W Z)
			  ( LEQ W V)
			  (ORDERED2 (CONS V (CONS W D)))
			  (NOT (LISTP D))
			  (LESSP V Z))
		     ( LEQ V Z)).

      But this again simplifies, using linear arithmetic, to:

            T.

    Case 3.1.1.
            (IMPLIES (AND ( LEQ W Z)
			  ( LEQ W V)
			  (ORDERED2 (CONS V (CONS W D)))
			  ( LEQ (CAR D) W)
			  (ORDERED2 D)
			  (LESSP V Z))
		     ( LEQ V Z)),

      which we again simplify, using linear arithmetic, to:

            T.

Case 2. (IMPLIES (AND (LISTP Y)
		      (NOT (LISTP (CDR Y)))
		      (ORDERED2 Y))
		 (ORDERED2 (ADDTOLIST2 V Y))).

  This simplifies, opening up the definitions of ORDERED2 and
  ADDTOLIST2, to two new goals:

  Case 2.2.
          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			( LEQ (CAR Y) V))
		   (ORDERED2 (CONS V Y))),

    which we again simplify, applying the lemmas CAR-CONS and
    CDR-CONS, and opening up the definition of ORDERED2, to:

          T.

  Case 2.1.
          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(LESSP V (CAR Y)))
		   (ORDERED2 (CONS (CAR Y)
				   (ADDTOLIST2 V (CDR Y))))),

    which we again simplify, appealing to the lemmas CAR-CONS and
    CDR-CONS, and unfolding the function ORDERED2, to the following
    two new goals:

    Case 2.1.2.
            (IMPLIES (AND (LISTP Y)
			  (NOT (LISTP (CDR Y)))
			  (LESSP V (CAR Y)))
		     ( LEQ
		       (CAR (ADDTOLIST2 V (CDR Y)))
		       (CAR Y))).

      But this simplifies further, applying CAR-CONS, and expanding
      ADDTOLIST2, to:

            (IMPLIES (AND (LISTP Y)
			  (NOT (LISTP (CDR Y)))
			  (LESSP V (CAR Y)))
		     ( LEQ V (CAR Y))).

      But this again simplifies, using linear arithmetic, to:

            T.

    Case 2.1.1.
            (IMPLIES (AND (LISTP Y)
			  (NOT (LISTP (CDR Y)))
			  (LESSP V (CAR Y)))
		     (ORDERED2 (ADDTOLIST2 V (CDR Y)))),

      which further simplifies, applying CDR-CONS, and expanding the
      functions ADDTOLIST2, LISTP, and ORDERED2, to:

            T.

Case 1. (IMPLIES (AND (NOT (LISTP Y)) (ORDERED2 Y))
		 (ORDERED2 (ADDTOLIST2 V Y))),

  which simplifies, appealing to the lemma CDR-CONS, and opening up
  ORDERED2, ADDTOLIST2, and LISTP, to:

        T.


     That finishes the proof of *1.1, which, consequently, also
finishes the proof of *1.  Q.E.D.


[ 7.9680664 0.8499349 ]

SORT2-GEN-2 


(PROVE-LEMMA SORT2-GEN
	     (GENERALIZE)
	     (AND (PLISTP (SORT2 X))
		  (ORDERED2 (SORT2 X))))
This formula can be simplified, using the abbreviation AND, to the
following two new goals:

Case 2. (PLISTP (SORT2 X)).

  This simplifies, rewriting with SORT2-GEN-1, to:

        T.

Case 1. (ORDERED2 (SORT2 X)).

  This simplifies, applying SORT2-GEN-2, to:

        T.

Q.E.D.


[ 0.192008464 0.046972656 ]

SORT2-GEN 


(PROVE-LEMMA ADDTOLIST2-DELETE
	     (REWRITE)
	     (IMPLIES (AND (PLISTP Y)
			   (ORDERED2 Y)
			   (NOT (EQUAL X V)))
		      (EQUAL (ADDTOLIST2 V (DELETE X Y))
			     (DELETE X (ADDTOLIST2 V Y)))))

     Name the conjecture *1.


     Perhaps we can prove it by induction.  The recursive terms in
the conjecture suggest four inductions.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (LISTP Y)
			 (LISTP (CDR Y))
			 (LESSP (CAR Y) (CADR Y)))
		    (P V X Y))
	   (IMPLIES (AND (LISTP Y)
			 (LISTP (CDR Y))
			 ( LEQ (CADR Y) (CAR Y))
			 (P V X (CDR Y)))
		    (P V X Y))
	   (IMPLIES (AND (LISTP Y) (NOT (LISTP (CDR Y))))
		    (P V X Y))
	   (IMPLIES (NOT (LISTP Y)) (P V X Y))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
produces six new formulas:

Case 6. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      (LESSP (CAR Y) (CADR Y))
		      (PLISTP Y)
		      (ORDERED2 Y)
		      (NOT (EQUAL X V)))
		 (EQUAL (ADDTOLIST2 V (DELETE X Y))
			(DELETE X (ADDTOLIST2 V Y)))).

  This simplifies, opening up the definitions of PLISTP and ORDERED2,
  to:

        T.

Case 5. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CADR Y) (CAR Y))
		      (NOT (PLISTP (CDR Y)))
		      (PLISTP Y)
		      (ORDERED2 Y)
		      (NOT (EQUAL X V)))
		 (EQUAL (ADDTOLIST2 V (DELETE X Y))
			(DELETE X (ADDTOLIST2 V Y)))),

  which we simplify, opening up PLISTP, to:

        T.

Case 4. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CADR Y) (CAR Y))
		      (NOT (ORDERED2 (CDR Y)))
		      (PLISTP Y)
		      (ORDERED2 Y)
		      (NOT (EQUAL X V)))
		 (EQUAL (ADDTOLIST2 V (DELETE X Y))
			(DELETE X (ADDTOLIST2 V Y)))),

  which we simplify, unfolding PLISTP and ORDERED2, to:

        T.

Case 3. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CADR Y) (CAR Y))
		      (EQUAL (ADDTOLIST2 V (DELETE X (CDR Y)))
			     (DELETE X (ADDTOLIST2 V (CDR Y))))
		      (PLISTP Y)
		      (ORDERED2 Y)
		      (NOT (EQUAL X V)))
		 (EQUAL (ADDTOLIST2 V (DELETE X Y))
			(DELETE X (ADDTOLIST2 V Y)))).

  This simplifies, opening up PLISTP, ORDERED2, DELETE, and
  ADDTOLIST2, to the following four new formulas:

  Case 3.4.
          (IMPLIES
		 (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CADR Y) (CAR Y))
		      (EQUAL (ADDTOLIST2 V (DELETE X (CDR Y)))
			     (DELETE X (ADDTOLIST2 V (CDR Y))))
		      (PLISTP (CDR Y))
		      (ORDERED2 (CDR Y))
		      (NOT (EQUAL X V))
		      ( LEQ (CAR Y) V)
		      (NOT (EQUAL X (CAR Y))))
		 (EQUAL (ADDTOLIST2 V
				    (CONS (CAR Y) (DELETE X (CDR Y))))
			(DELETE X (CONS V Y)))),

    which we again simplify, rewriting with the lemmas CAR-CONS and
    CDR-CONS, and expanding the definitions of ADDTOLIST2 and DELETE,
    to:

          T.

  Case 3.3.
          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CADR Y) (CAR Y))
			(EQUAL (ADDTOLIST2 V (DELETE X (CDR Y)))
			       (DELETE X (ADDTOLIST2 V (CDR Y))))
			(PLISTP (CDR Y))
			(ORDERED2 (CDR Y))
			(NOT (EQUAL X V))
			( LEQ (CAR Y) V)
			(EQUAL X (CAR Y)))
		   (EQUAL (ADDTOLIST2 V (CDR Y))
			  (DELETE X (CONS V Y)))),

    which we again simplify, rewriting with the lemmas CDR-CONS and
    CAR-CONS, and unfolding DELETE, to:

          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CADR Y) (CAR Y))
			(EQUAL (ADDTOLIST2 V
					   (DELETE (CAR Y) (CDR Y)))
			       (DELETE (CAR Y)
				       (ADDTOLIST2 V (CDR Y))))
			(PLISTP (CDR Y))
			(ORDERED2 (CDR Y))
			(NOT (EQUAL (CAR Y) V))
			( LEQ (CAR Y) V))
		   (EQUAL (ADDTOLIST2 V (CDR Y))
			  (CONS V (CDR Y)))).

    Appealing to the lemma CAR-CDR-ELIM, we now replace Y by
    (CONS W Z) to eliminate (CDR Y) and (CAR Y) and Z by (CONS D C)
    to eliminate (CAR Z) and (CDR Z).  We would thus like to prove:

          (IMPLIES (AND ( LEQ D W)
			(EQUAL (ADDTOLIST2 V (DELETE W (CONS D C)))
			       (DELETE W (ADDTOLIST2 V (CONS D C))))
			(PLISTP (CONS D C))
			(ORDERED2 (CONS D C))
			(NOT (EQUAL W V))
			( LEQ W V))
		   (EQUAL (ADDTOLIST2 V (CONS D C))
			  (CONS V (CONS D C)))).

    However this further simplifies, rewriting with the lemmas
    CDR-CONS, CAR-CONS, and CONS-EQUAL, and unfolding the definitions
    of DELETE, ADDTOLIST2, PLISTP, and ORDERED2, to four new
    conjectures:

    Case 3.3.4.
            (IMPLIES (AND ( LEQ D W)
			  (LESSP V D)
			  (NOT (EQUAL W D))
			  (EQUAL (ADDTOLIST2 V (CONS D (DELETE W C)))
				 (DELETE W (CONS D (ADDTOLIST2 V C))))
			  (PLISTP C)
			  (NOT (LISTP C))
			  (NOT (EQUAL W V))
			  ( LEQ W V))
		     (EQUAL D V)),

      which we again simplify, using linear arithmetic, to:

            T.

    Case 3.3.3.
            (IMPLIES (AND ( LEQ D W)
			  (LESSP V D)
			  (NOT (EQUAL W D))
			  (EQUAL (ADDTOLIST2 V (CONS D (DELETE W C)))
				 (DELETE W (CONS D (ADDTOLIST2 V C))))
			  (PLISTP C)
			  (NOT (LISTP C))
			  (NOT (EQUAL W V))
			  ( LEQ W V))
		     (EQUAL NIL C)),

      which again simplifies, using linear arithmetic, to:

            T.

    Case 3.3.2.
            (IMPLIES (AND ( LEQ D W)
			  (LESSP V D)
			  (NOT (EQUAL W D))
			  (EQUAL (ADDTOLIST2 V (CONS D (DELETE W C)))
				 (DELETE W (CONS D (ADDTOLIST2 V C))))
			  (PLISTP C)
			  ( LEQ (CAR C) D)
			  (ORDERED2 C)
			  (NOT (EQUAL W V))
			  ( LEQ W V))
		     (EQUAL D V)),

      which we again simplify, using linear arithmetic, to:

            T.

    Case 3.3.1.
            (IMPLIES (AND ( LEQ D W)
			  (LESSP V D)
			  (NOT (EQUAL W D))
			  (EQUAL (ADDTOLIST2 V (CONS D (DELETE W C)))
				 (DELETE W (CONS D (ADDTOLIST2 V C))))
			  (PLISTP C)
			  ( LEQ (CAR C) D)
			  (ORDERED2 C)
			  (NOT (EQUAL W V))
			  ( LEQ W V))
		     (EQUAL (ADDTOLIST2 V C) (CONS D C))).

      However this again simplifies, using linear arithmetic, to:

            T.

  Case 3.2.
          (IMPLIES
		 (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CADR Y) (CAR Y))
		      (EQUAL (ADDTOLIST2 V (DELETE X (CDR Y)))
			     (DELETE X (ADDTOLIST2 V (CDR Y))))
		      (PLISTP (CDR Y))
		      (ORDERED2 (CDR Y))
		      (NOT (EQUAL X V))
		      (LESSP V (CAR Y))
		      (NOT (EQUAL X (CAR Y))))
		 (EQUAL (ADDTOLIST2 V
				    (CONS (CAR Y) (DELETE X (CDR Y))))
			(DELETE X
				(CONS (CAR Y)
				      (ADDTOLIST2 V (CDR Y)))))),

    which again simplifies, applying CDR-CONS and CAR-CONS, and
    opening up the functions ADDTOLIST2 and DELETE, to:

          T.

  Case 3.1.
          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CADR Y) (CAR Y))
			(EQUAL (ADDTOLIST2 V (DELETE X (CDR Y)))
			       (DELETE X (ADDTOLIST2 V (CDR Y))))
			(PLISTP (CDR Y))
			(ORDERED2 (CDR Y))
			(NOT (EQUAL X V))
			(LESSP V (CAR Y))
			(EQUAL X (CAR Y)))
		   (EQUAL (ADDTOLIST2 V (CDR Y))
			  (DELETE X
				  (CONS (CAR Y)
					(ADDTOLIST2 V (CDR Y)))))).

    This simplifies again, applying the lemmas CDR-CONS and CAR-CONS,
    and opening up the definition of DELETE, to:

          T.

Case 2. (IMPLIES (AND (LISTP Y)
		      (NOT (LISTP (CDR Y)))
		      (PLISTP Y)
		      (ORDERED2 Y)
		      (NOT (EQUAL X V)))
		 (EQUAL (ADDTOLIST2 V (DELETE X Y))
			(DELETE X (ADDTOLIST2 V Y)))),

  which we simplify, expanding the functions PLISTP, ORDERED2, DELETE,
  and ADDTOLIST2, to four new conjectures:

  Case 2.4.
          (IMPLIES
		 (AND (LISTP Y)
		      (NOT (LISTP (CDR Y)))
		      (PLISTP (CDR Y))
		      (NOT (EQUAL X V))
		      ( LEQ (CAR Y) V)
		      (NOT (EQUAL X (CAR Y))))
		 (EQUAL (ADDTOLIST2 V
				    (CONS (CAR Y) (DELETE X (CDR Y))))
			(DELETE X (CONS V Y)))),

    which we again simplify, applying CAR-CONS, CDR-CONS,
    DELETE-NON-MEMBER, and CONS-EQUAL, and unfolding the functions
    ADDTOLIST2 and MEMBER, to the new goal:

          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(PLISTP (CDR Y))
			(NOT (EQUAL X V))
			( LEQ (CAR Y) V)
			(NOT (EQUAL X (CAR Y))))
		   (EQUAL (CONS (CAR Y) (DELETE X (CDR Y)))
			  Y)).

    But this further simplifies, rewriting with the lemmas
    DELETE-NON-MEMBER, CAR-CONS, and CDR-CONS, and expanding the
    definitions of PLISTP, MEMBER, LISTP, and EQUAL, to:

          T.

  Case 2.3.
          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(PLISTP (CDR Y))
			(NOT (EQUAL X V))
			( LEQ (CAR Y) V)
			(EQUAL X (CAR Y)))
		   (EQUAL (ADDTOLIST2 V (CDR Y))
			  (DELETE X (CONS V Y)))).

    This again simplifies, rewriting with the lemmas CDR-CONS and
    CAR-CONS, and expanding the function DELETE, to:

          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(PLISTP (CDR Y))
			(NOT (EQUAL (CAR Y) V))
			( LEQ (CAR Y) V))
		   (EQUAL (ADDTOLIST2 V (CDR Y))
			  (CONS V (CDR Y)))),

    which we further simplify, expanding the definitions of PLISTP,
    LISTP, and ADDTOLIST2, to:

          T.

  Case 2.2.
          (IMPLIES
		 (AND (LISTP Y)
		      (NOT (LISTP (CDR Y)))
		      (PLISTP (CDR Y))
		      (NOT (EQUAL X V))
		      (LESSP V (CAR Y))
		      (NOT (EQUAL X (CAR Y))))
		 (EQUAL (ADDTOLIST2 V
				    (CONS (CAR Y) (DELETE X (CDR Y))))
			(DELETE X
				(CONS (CAR Y)
				      (ADDTOLIST2 V (CDR Y)))))).

    But this again simplifies, rewriting with CDR-CONS, CAR-CONS, and
    CONS-EQUAL, and expanding the definitions of ADDTOLIST2 and
    DELETE, to:

          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(PLISTP (CDR Y))
			(NOT (EQUAL X V))
			(LESSP V (CAR Y))
			(NOT (EQUAL X (CAR Y))))
		   (EQUAL (ADDTOLIST2 V (DELETE X (CDR Y)))
			  (DELETE X (ADDTOLIST2 V (CDR Y))))).

    This simplifies further, rewriting with the lemmas
    DELETE-NON-MEMBER, CAR-CONS, and CDR-CONS, and expanding the
    functions PLISTP, MEMBER, LISTP, and ADDTOLIST2, to:

          T.

  Case 2.1.
          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(PLISTP (CDR Y))
			(NOT (EQUAL X V))
			(LESSP V (CAR Y))
			(EQUAL X (CAR Y)))
		   (EQUAL (ADDTOLIST2 V (CDR Y))
			  (DELETE X
				  (CONS (CAR Y)
					(ADDTOLIST2 V (CDR Y)))))).

    However this simplifies again, rewriting with the lemmas CDR-CONS
    and CAR-CONS, and unfolding the function DELETE, to:

          T.

Case 1. (IMPLIES (AND (NOT (LISTP Y))
		      (PLISTP Y)
		      (ORDERED2 Y)
		      (NOT (EQUAL X V)))
		 (EQUAL (ADDTOLIST2 V (DELETE X Y))
			(DELETE X (ADDTOLIST2 V Y)))),

  which simplifies, rewriting with DELETE-NON-MEMBER, CAR-CONS, and
  CDR-CONS, and expanding PLISTP, ORDERED2, MEMBER, LISTP, and
  ADDTOLIST2, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 17.2350261 1.18299153 ]

ADDTOLIST2-DELETE 


(PROVE-LEMMA DELETE-ADDTOLIST2
	     (REWRITE)
	     (IMPLIES (PLISTP Y)
		      (EQUAL (DELETE V (ADDTOLIST2 V Y))
			     Y)))

     Name the conjecture *1.


     Perhaps we can prove it by induction.  The recursive terms in
the conjecture suggest two inductions.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (LISTP Y)
			 (LESSP V (CAR Y))
			 (P V (CDR Y)))
		    (P V Y))
	   (IMPLIES (AND (LISTP Y) ( LEQ (CAR Y) V))
		    (P V Y))
	   (IMPLIES (NOT (LISTP Y)) (P V Y))).
Linear arithmetic and the lemma CDR-LESSP can be used to prove that
the measure (COUNT Y) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme generates four new conjectures:

Case 4. (IMPLIES (AND (LISTP Y)
		      (LESSP V (CAR Y))
		      (NOT (PLISTP (CDR Y)))
		      (PLISTP Y))
		 (EQUAL (DELETE V (ADDTOLIST2 V Y))
			Y)),

  which simplifies, opening up the definition of PLISTP, to:

        T.

Case 3. (IMPLIES (AND (LISTP Y)
		      (LESSP V (CAR Y))
		      (EQUAL (DELETE V (ADDTOLIST2 V (CDR Y)))
			     (CDR Y))
		      (PLISTP Y))
		 (EQUAL (DELETE V (ADDTOLIST2 V Y))
			Y)).

  This simplifies, applying CONS-CAR-CDR, CDR-CONS, and CAR-CONS, and
  opening up the definitions of PLISTP, ADDTOLIST2, and DELETE, to:

        (IMPLIES (AND (LISTP Y)
		      (LESSP V (CAR Y))
		      (EQUAL (DELETE V (ADDTOLIST2 V (CDR Y)))
			     (CDR Y))
		      (PLISTP (CDR Y))
		      (EQUAL V (CAR Y)))
		 (EQUAL (ADDTOLIST2 V (CDR Y)) Y)),

  which we again simplify, using linear arithmetic, to:

        T.

Case 2. (IMPLIES (AND (LISTP Y)
		      ( LEQ (CAR Y) V)
		      (PLISTP Y))
		 (EQUAL (DELETE V (ADDTOLIST2 V Y))
			Y)).

  This simplifies, rewriting with the lemmas CDR-CONS and CAR-CONS,
  and unfolding the functions PLISTP, ADDTOLIST2, and DELETE, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP Y)) (PLISTP Y))
		 (EQUAL (DELETE V (ADDTOLIST2 V Y))
			Y)).

  This simplifies, rewriting with CDR-CONS and CAR-CONS, and
  expanding PLISTP, LISTP, ADDTOLIST2, DELETE, and EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.09399414 0.28300781 ]

DELETE-ADDTOLIST2 


(PROVE-LEMMA ADDTOLIST2-KLUDGE
	     (REWRITE)
	     (IMPLIES (AND ( LEQ W V)
			   (EQUAL (ADDTOLIST2 V Y) (CONS V Y)))
		      (EQUAL (ADDTOLIST2 V (ADDTOLIST2 W Y))
			     (CONS V (ADDTOLIST2 W Y)))))

     Give the conjecture the name *1.


     We will appeal to induction.  There are five plausible
inductions.  They merge into two likely candidate inductions.
However, only one is unflawed.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (LISTP Y)
			 (LESSP V (CAR Y))
			 (P V W (CDR Y)))
		    (P V W Y))
	   (IMPLIES (AND (LISTP Y) ( LEQ (CAR Y) V))
		    (P V W Y))
	   (IMPLIES (NOT (LISTP Y)) (P V W Y))).
Linear arithmetic and the lemma CDR-LESSP can be used to establish
that the measure (COUNT Y) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme produces four new conjectures:

Case 4. (IMPLIES (AND (LISTP Y)
		      (LESSP V (CAR Y))
		      (NOT (EQUAL (ADDTOLIST2 V (CDR Y))
				  (CONS V (CDR Y))))
		      ( LEQ W V)
		      (EQUAL (ADDTOLIST2 V Y) (CONS V Y)))
		 (EQUAL (ADDTOLIST2 V (ADDTOLIST2 W Y))
			(CONS V (ADDTOLIST2 W Y)))).

  This simplifies, appealing to the lemmas CAR-CONS and CONS-EQUAL,
  and expanding ADDTOLIST2, to the following two new conjectures:

  Case 4.2.
          (IMPLIES (AND (LISTP Y)
			(LESSP V (CAR Y))
			(NOT (EQUAL (ADDTOLIST2 V (CDR Y))
				    (CONS V (CDR Y))))
			( LEQ W V)
			(EQUAL (CAR Y) V)
			(EQUAL (ADDTOLIST2 V (CDR Y)) Y)
			( LEQ V W))
		   (EQUAL (ADDTOLIST2 V (CONS W Y))
			  (CONS V (CONS W Y)))).

    This simplifies again, using linear arithmetic, to:

          T.

  Case 4.1.
          (IMPLIES (AND (LISTP Y)
			(LESSP V (CAR Y))
			(NOT (EQUAL (ADDTOLIST2 V (CDR Y))
				    (CONS V (CDR Y))))
			( LEQ W V)
			(EQUAL (CAR Y) V)
			(EQUAL (ADDTOLIST2 V (CDR Y)) Y)
			(LESSP W V))
		   (EQUAL (ADDTOLIST2 V
				      (CONS V (ADDTOLIST2 W (CDR Y))))
			  (CONS V
				(CONS V (ADDTOLIST2 W (CDR Y)))))),

    which we again simplify, using linear arithmetic, to:

          T.

Case 3. (IMPLIES (AND (LISTP Y)
		      (LESSP V (CAR Y))
		      (EQUAL (ADDTOLIST2 V (ADDTOLIST2 W (CDR Y)))
			     (CONS V (ADDTOLIST2 W (CDR Y))))
		      ( LEQ W V)
		      (EQUAL (ADDTOLIST2 V Y) (CONS V Y)))
		 (EQUAL (ADDTOLIST2 V (ADDTOLIST2 W Y))
			(CONS V (ADDTOLIST2 W Y)))).

  This simplifies, rewriting with the lemmas CAR-CONS and CONS-EQUAL,
  and unfolding the function ADDTOLIST2, to the following two new
  goals:

  Case 3.2.
          (IMPLIES (AND (LISTP Y)
			(LESSP V (CAR Y))
			(EQUAL (ADDTOLIST2 V (ADDTOLIST2 W (CDR Y)))
			       (CONS V (ADDTOLIST2 W (CDR Y))))
			( LEQ W V)
			(EQUAL (CAR Y) V)
			(EQUAL (ADDTOLIST2 V (CDR Y)) Y)
			( LEQ V W))
		   (EQUAL (ADDTOLIST2 V (CONS W Y))
			  (CONS V (CONS W Y)))),

    which again simplifies, using linear arithmetic, to:

          T.

  Case 3.1.
          (IMPLIES
	     (AND (LISTP Y)
		  (LESSP V (CAR Y))
		  (EQUAL (ADDTOLIST2 V (ADDTOLIST2 W (CDR Y)))
			 (CONS V (ADDTOLIST2 W (CDR Y))))
		  ( LEQ W V)
		  (EQUAL (CAR Y) V)
		  (EQUAL (ADDTOLIST2 V (CDR Y)) Y)
		  (LESSP W V))
	     (EQUAL (ADDTOLIST2 V
				(ADDTOLIST2 V (ADDTOLIST2 W (CDR Y))))
		    (CONS V
			  (ADDTOLIST2 V
				      (ADDTOLIST2 W (CDR Y)))))),

    which we again simplify, using linear arithmetic, to:

          T.

Case 2. (IMPLIES (AND (LISTP Y)
		      ( LEQ (CAR Y) V)
		      ( LEQ W V)
		      (EQUAL (ADDTOLIST2 V Y) (CONS V Y)))
		 (EQUAL (ADDTOLIST2 V (ADDTOLIST2 W Y))
			(CONS V (ADDTOLIST2 W Y)))),

  which we simplify, rewriting with CAR-CONS, and expanding the
  definition of ADDTOLIST2, to two new conjectures:

  Case 2.2.
          (IMPLIES (AND (LISTP Y)
			( LEQ (CAR Y) V)
			( LEQ W V)
			( LEQ (CAR Y) W))
		   (EQUAL (ADDTOLIST2 V (CONS W Y))
			  (CONS V (CONS W Y)))),

    which we again simplify, rewriting with CAR-CONS, and unfolding
    the definition of ADDTOLIST2, to:

          T.

  Case 2.1.
          (IMPLIES
	     (AND (LISTP Y)
		  ( LEQ (CAR Y) V)
		  ( LEQ W V)
		  (LESSP W (CAR Y)))
	     (EQUAL (ADDTOLIST2 V
				(CONS (CAR Y) (ADDTOLIST2 W (CDR Y))))
		    (CONS V
			  (CONS (CAR Y)
				(ADDTOLIST2 W (CDR Y)))))).

    However this simplifies again, applying CAR-CONS, and opening up
    ADDTOLIST2, to:

          T.

Case 1. (IMPLIES (AND (NOT (LISTP Y))
		      ( LEQ W V)
		      (EQUAL (ADDTOLIST2 V Y) (CONS V Y)))
		 (EQUAL (ADDTOLIST2 V (ADDTOLIST2 W Y))
			(CONS V (ADDTOLIST2 W Y)))).

  This simplifies, rewriting with CAR-CONS, CDR-CONS, and CONS-EQUAL,
  and unfolding the definitions of ADDTOLIST2 and LISTP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 4.31300455 0.51998698 ]

ADDTOLIST2-KLUDGE 


(PROVE-LEMMA LESSP-MAXIMUM-ADDTOLIST2
	     (REWRITE)
	     (IMPLIES ( LEQ (MAXIMUM Z) V)
		      (EQUAL (ADDTOLIST2 V (SORT2 Z))
			     (CONS V (SORT2 Z)))))

     Give the conjecture the name *1.


     We will try to prove it by induction.  Four inductions are
suggested by terms in the conjecture.  They merge into two likely
candidate inductions, both of which are unflawed.  However, one of
these is more likely than the other.  We will induct according to the
following scheme:
      (AND (IMPLIES (NLISTP Z) (P V Z))
	   (IMPLIES (AND (NOT (NLISTP Z))
			 (LESSP (CAR Z) (MAXIMUM (CDR Z)))
			 (P V (CDR Z)))
		    (P V Z))
	   (IMPLIES (AND (NOT (NLISTP Z))
			 ( LEQ (MAXIMUM (CDR Z)) (CAR Z))
			 (P V (CDR Z)))
		    (P V Z))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT Z) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme leads to the following
five new goals:

Case 5. (IMPLIES (AND (NLISTP Z) ( LEQ (MAXIMUM Z) V))
		 (EQUAL (ADDTOLIST2 V (SORT2 Z))
			(CONS V (SORT2 Z)))),

  which we simplify, expanding NLISTP, MAXIMUM, EQUAL, LESSP, SORT2,
  LISTP, and ADDTOLIST2, to:

        T.

Case 4. (IMPLIES (AND (NOT (NLISTP Z))
		      (LESSP (CAR Z) (MAXIMUM (CDR Z)))
		      (LESSP V (MAXIMUM (CDR Z)))
		      ( LEQ (MAXIMUM Z) V))
		 (EQUAL (ADDTOLIST2 V (SORT2 Z))
			(CONS V (SORT2 Z)))).

  This simplifies, expanding NLISTP and MAXIMUM, to:

        T.

Case 3. (IMPLIES (AND (NOT (NLISTP Z))
		      (LESSP (CAR Z) (MAXIMUM (CDR Z)))
		      (EQUAL (ADDTOLIST2 V (SORT2 (CDR Z)))
			     (CONS V (SORT2 (CDR Z))))
		      ( LEQ (MAXIMUM Z) V))
		 (EQUAL (ADDTOLIST2 V (SORT2 Z))
			(CONS V (SORT2 Z)))).

  This simplifies, applying the lemma CAR-CONS, and expanding the
  definitions of NLISTP, MAXIMUM, and SORT2, to the formula:

        (IMPLIES
	      (AND (LISTP Z)
		   (LESSP (CAR Z) (MAXIMUM (CDR Z)))
		   (EQUAL (ADDTOLIST2 V (SORT2 (CDR Z)))
			  (CONS V (SORT2 (CDR Z))))
		   ( LEQ (MAXIMUM (CDR Z)) V))
	      (EQUAL (ADDTOLIST2 V
				 (ADDTOLIST2 (CAR Z) (SORT2 (CDR Z))))
		     (CONS V
			   (ADDTOLIST2 (CAR Z)
				       (SORT2 (CDR Z)))))),

  which again simplifies, using linear arithmetic and rewriting with
  CAR-CONS and ADDTOLIST2-KLUDGE, to:

        T.

Case 2. (IMPLIES (AND (NOT (NLISTP Z))
		      ( LEQ (MAXIMUM (CDR Z)) (CAR Z))
		      (LESSP V (MAXIMUM (CDR Z)))
		      ( LEQ (MAXIMUM Z) V))
		 (EQUAL (ADDTOLIST2 V (SORT2 Z))
			(CONS V (SORT2 Z)))).

  This simplifies, rewriting with the lemma CAR-CONS, and expanding
  NLISTP, MAXIMUM, and SORT2, to:

        (IMPLIES
	      (AND (LISTP Z)
		   ( LEQ (MAXIMUM (CDR Z)) (CAR Z))
		   (LESSP V (MAXIMUM (CDR Z)))
		   ( LEQ (CAR Z) V))
	      (EQUAL (ADDTOLIST2 V
				 (ADDTOLIST2 (CAR Z) (SORT2 (CDR Z))))
		     (CONS V
			   (ADDTOLIST2 (CAR Z)
				       (SORT2 (CDR Z)))))),

  which we again simplify, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP Z))
		      ( LEQ (MAXIMUM (CDR Z)) (CAR Z))
		      (EQUAL (ADDTOLIST2 V (SORT2 (CDR Z)))
			     (CONS V (SORT2 (CDR Z))))
		      ( LEQ (MAXIMUM Z) V))
		 (EQUAL (ADDTOLIST2 V (SORT2 Z))
			(CONS V (SORT2 Z)))),

  which we simplify, applying CAR-CONS and ADDTOLIST2-KLUDGE, and
  expanding the definitions of NLISTP, MAXIMUM, and SORT2, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 3.4210612 0.407926433 ]

LESSP-MAXIMUM-ADDTOLIST2 


(PROVE-LEMMA SORT2-DELETE-CONS
	     (REWRITE)
	     (IMPLIES (LISTP X)
		      (EQUAL (CONS (MAXIMUM X)
				   (DELETE (MAXIMUM X) (SORT2 X)))
			     (SORT2 X))))

     Call the conjecture *1.


     Perhaps we can prove it by induction.  There are four plausible
inductions.  However, they merge into one likely candidate induction.
We will induct according to the following scheme:
      (AND (IMPLIES (NLISTP X) (P X))
	   (IMPLIES (AND (NOT (NLISTP X))
			 (LESSP (CAR X) (MAXIMUM (CDR X)))
			 (P (CDR X)))
		    (P X))
	   (IMPLIES (AND (NOT (NLISTP X))
			 ( LEQ (MAXIMUM (CDR X)) (CAR X))
			 (P (CDR X)))
		    (P X))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP establish that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme produces five new formulas:

Case 5. (IMPLIES (AND (NLISTP X) (LISTP X))
		 (EQUAL (CONS (MAXIMUM X)
			      (DELETE (MAXIMUM X) (SORT2 X)))
			(SORT2 X))).

  This simplifies, expanding the definition of NLISTP, to:

        T.

Case 4. (IMPLIES (AND (NOT (NLISTP X))
		      (LESSP (CAR X) (MAXIMUM (CDR X)))
		      (NOT (LISTP (CDR X)))
		      (LISTP X))
		 (EQUAL (CONS (MAXIMUM X)
			      (DELETE (MAXIMUM X) (SORT2 X)))
			(SORT2 X))),

  which simplifies, applying the lemma CAR-CONS, and unfolding NLISTP,
  MAXIMUM, and SORT2, to:

        (IMPLIES
	   (AND (LESSP (CAR X) (MAXIMUM (CDR X)))
		(NOT (LISTP (CDR X)))
		(LISTP X))
	   (EQUAL (CONS (MAXIMUM (CDR X))
			(DELETE (MAXIMUM (CDR X))
				(ADDTOLIST2 (CAR X) (SORT2 (CDR X)))))
		  (ADDTOLIST2 (CAR X)
			      (SORT2 (CDR X))))).

  This simplifies further, expanding the functions MAXIMUM, EQUAL,
  and LESSP, to:

        T.

Case 3. (IMPLIES (AND (NOT (NLISTP X))
		      (LESSP (CAR X) (MAXIMUM (CDR X)))
		      (EQUAL (CONS (MAXIMUM (CDR X))
				   (DELETE (MAXIMUM (CDR X))
					   (SORT2 (CDR X))))
			     (SORT2 (CDR X)))
		      (LISTP X))
		 (EQUAL (CONS (MAXIMUM X)
			      (DELETE (MAXIMUM X) (SORT2 X)))
			(SORT2 X))).

  This simplifies, rewriting with the lemma CAR-CONS, and unfolding
  the functions NLISTP, MAXIMUM, and SORT2, to the formula:

        (IMPLIES
	   (AND (LESSP (CAR X) (MAXIMUM (CDR X)))
		(EQUAL (CONS (MAXIMUM (CDR X))
			     (DELETE (MAXIMUM (CDR X))
				     (SORT2 (CDR X))))
		       (SORT2 (CDR X)))
		(LISTP X))
	   (EQUAL (CONS (MAXIMUM (CDR X))
			(DELETE (MAXIMUM (CDR X))
				(ADDTOLIST2 (CAR X) (SORT2 (CDR X)))))
		  (ADDTOLIST2 (CAR X)
			      (SORT2 (CDR X))))).

  Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V)
  to eliminate (CAR X) and (CDR X).  We would thus like to prove:

        (IMPLIES (AND (LESSP Z (MAXIMUM V))
		      (EQUAL (CONS (MAXIMUM V)
				   (DELETE (MAXIMUM V) (SORT2 V)))
			     (SORT2 V)))
		 (EQUAL (CONS (MAXIMUM V)
			      (DELETE (MAXIMUM V)
				      (ADDTOLIST2 Z (SORT2 V))))
			(ADDTOLIST2 Z (SORT2 V)))).

  We use the above equality hypothesis by cross-fertilizing:
        (CONS (MAXIMUM V)
	      (DELETE (MAXIMUM V) (SORT2 V)))
  for (SORT2 V) and throwing away the equality.  This produces:

        (IMPLIES
	  (LESSP Z (MAXIMUM V))
	  (EQUAL (CONS (MAXIMUM V)
		       (DELETE (MAXIMUM V)
			       (ADDTOLIST2 Z (SORT2 V))))
		 (ADDTOLIST2 Z
			     (CONS (MAXIMUM V)
				   (DELETE (MAXIMUM V) (SORT2 V)))))).

  This simplifies further, rewriting with the lemmas CDR-CONS,
  CAR-CONS, and CONS-EQUAL, and unfolding ADDTOLIST2, to:

        (IMPLIES (LESSP Z (MAXIMUM V))
		 (EQUAL (DELETE (MAXIMUM V)
				(ADDTOLIST2 Z (SORT2 V)))
			(ADDTOLIST2 Z
				    (DELETE (MAXIMUM V) (SORT2 V))))).

  We will try to prove the above formula by generalizing it,
  replacing (SORT2 V) by Y and (MAXIMUM V) by A.  We restrict the new
  variables by appealing to SORT2-GEN.  The result is the new
  conjecture:

        (IMPLIES (AND (AND (PLISTP Y) (ORDERED2 Y))
		      (LESSP Z A))
		 (EQUAL (DELETE A (ADDTOLIST2 Z Y))
			(ADDTOLIST2 Z (DELETE A Y)))),

  which we further simplify, unfolding the definition of AND, to the
  formula:

        (IMPLIES (AND (PLISTP Y)
		      (ORDERED2 Y)
		      (LESSP Z A))
		 (EQUAL (DELETE A (ADDTOLIST2 Z Y))
			(ADDTOLIST2 Z (DELETE A Y)))),

  which we will finally name *1.1.

Case 2. (IMPLIES (AND (NOT (NLISTP X))
		      ( LEQ (MAXIMUM (CDR X)) (CAR X))
		      (NOT (LISTP (CDR X)))
		      (LISTP X))
		 (EQUAL (CONS (MAXIMUM X)
			      (DELETE (MAXIMUM X) (SORT2 X)))
			(SORT2 X))),

  which simplifies, applying LESSP-MAXIMUM-ADDTOLIST2, CDR-CONS, and
  CAR-CONS, and expanding the functions NLISTP, MAXIMUM, SORT2, and
  DELETE, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP X))
		      ( LEQ (MAXIMUM (CDR X)) (CAR X))
		      (EQUAL (CONS (MAXIMUM (CDR X))
				   (DELETE (MAXIMUM (CDR X))
					   (SORT2 (CDR X))))
			     (SORT2 (CDR X)))
		      (LISTP X))
		 (EQUAL (CONS (MAXIMUM X)
			      (DELETE (MAXIMUM X) (SORT2 X)))
			(SORT2 X))),

  which simplifies, applying LESSP-MAXIMUM-ADDTOLIST2, CDR-CONS, and
  CAR-CONS, and opening up the definitions of NLISTP, MAXIMUM, SORT2,
  and DELETE, to:

        T.


     So next consider:

      (IMPLIES (AND (PLISTP Y)
		    (ORDERED2 Y)
		    (LESSP Z A))
	       (EQUAL (DELETE A (ADDTOLIST2 Z Y))
		      (ADDTOLIST2 Z (DELETE A Y)))),

named *1.1 above.  Perhaps we can prove it by induction.  Six
inductions are suggested by terms in the conjecture.  They merge into
two likely candidate inductions.  However, only one is unflawed.  We
will induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP Y)
			 (LISTP (CDR Y))
			 (LESSP (CAR Y) (CADR Y)))
		    (P A Z Y))
	   (IMPLIES (AND (LISTP Y)
			 (LISTP (CDR Y))
			 ( LEQ (CADR Y) (CAR Y))
			 (P A Z (CDR Y)))
		    (P A Z Y))
	   (IMPLIES (AND (LISTP Y) (NOT (LISTP (CDR Y))))
		    (P A Z Y))
	   (IMPLIES (NOT (LISTP Y)) (P A Z Y))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
produces the following six new goals:

Case 6. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      (LESSP (CAR Y) (CADR Y))
		      (PLISTP Y)
		      (ORDERED2 Y)
		      (LESSP Z A))
		 (EQUAL (DELETE A (ADDTOLIST2 Z Y))
			(ADDTOLIST2 Z (DELETE A Y)))),

  which we simplify, opening up the definitions of PLISTP and
  ORDERED2, to:

        T.

Case 5. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CADR Y) (CAR Y))
		      (NOT (PLISTP (CDR Y)))
		      (PLISTP Y)
		      (ORDERED2 Y)
		      (LESSP Z A))
		 (EQUAL (DELETE A (ADDTOLIST2 Z Y))
			(ADDTOLIST2 Z (DELETE A Y)))),

  which we simplify, expanding the function PLISTP, to:

        T.

Case 4. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CADR Y) (CAR Y))
		      (NOT (ORDERED2 (CDR Y)))
		      (PLISTP Y)
		      (ORDERED2 Y)
		      (LESSP Z A))
		 (EQUAL (DELETE A (ADDTOLIST2 Z Y))
			(ADDTOLIST2 Z (DELETE A Y)))),

  which we simplify, unfolding the functions PLISTP and ORDERED2, to:

        T.

Case 3. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CADR Y) (CAR Y))
		      (EQUAL (DELETE A (ADDTOLIST2 Z (CDR Y)))
			     (ADDTOLIST2 Z (DELETE A (CDR Y))))
		      (PLISTP Y)
		      (ORDERED2 Y)
		      (LESSP Z A))
		 (EQUAL (DELETE A (ADDTOLIST2 Z Y))
			(ADDTOLIST2 Z (DELETE A Y)))).

  This simplifies, opening up the definitions of PLISTP, ORDERED2,
  ADDTOLIST2, and DELETE, to four new conjectures:

  Case 3.4.
          (IMPLIES
	      (AND (LISTP Y)
		   (LISTP (CDR Y))
		   ( LEQ (CADR Y) (CAR Y))
		   (EQUAL (DELETE A (ADDTOLIST2 Z (CDR Y)))
			  (ADDTOLIST2 Z (DELETE A (CDR Y))))
		   (PLISTP (CDR Y))
		   (ORDERED2 (CDR Y))
		   (LESSP Z A)
		   (NOT (EQUAL A (CAR Y)))
		   ( LEQ (CAR Y) Z))
	      (EQUAL (DELETE A (CONS Z Y))
		     (ADDTOLIST2 Z
				 (CONS (CAR Y) (DELETE A (CDR Y)))))),

    which we again simplify, applying CDR-CONS and CAR-CONS, and
    expanding DELETE and ADDTOLIST2, to:

          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CADR Y) (CAR Y))
			(EQUAL (DELETE A (ADDTOLIST2 Z (CDR Y)))
			       (ADDTOLIST2 Z (DELETE A (CDR Y))))
			(PLISTP (CDR Y))
			(ORDERED2 (CDR Y))
			(LESSP Z A)
			(NOT (EQUAL A (CAR Y)))
			( LEQ (CAR Y) Z)
			(EQUAL A Z))
		   (EQUAL Y
			  (CONS Z
				(CONS (CAR Y) (DELETE A (CDR Y)))))).

    But this again simplifies, using linear arithmetic, to:

          T.

  Case 3.3.
          (IMPLIES
	      (AND (LISTP Y)
		   (LISTP (CDR Y))
		   ( LEQ (CADR Y) (CAR Y))
		   (EQUAL (DELETE A (ADDTOLIST2 Z (CDR Y)))
			  (ADDTOLIST2 Z (DELETE A (CDR Y))))
		   (PLISTP (CDR Y))
		   (ORDERED2 (CDR Y))
		   (LESSP Z A)
		   (NOT (EQUAL A (CAR Y)))
		   (LESSP Z (CAR Y)))
	      (EQUAL (DELETE A
			     (CONS (CAR Y) (ADDTOLIST2 Z (CDR Y))))
		     (ADDTOLIST2 Z
				 (CONS (CAR Y) (DELETE A (CDR Y)))))),

    which again simplifies, applying CDR-CONS and CAR-CONS, and
    expanding the functions DELETE and ADDTOLIST2, to:

          T.

  Case 3.2.
          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CADR Y) (CAR Y))
			(EQUAL (DELETE A (ADDTOLIST2 Z (CDR Y)))
			       (ADDTOLIST2 Z (DELETE A (CDR Y))))
			(PLISTP (CDR Y))
			(ORDERED2 (CDR Y))
			(LESSP Z A)
			(EQUAL A (CAR Y))
			( LEQ (CAR Y) Z))
		   (EQUAL (DELETE A (CONS Z Y))
			  (ADDTOLIST2 Z (CDR Y)))),

    which again simplifies, trivially, to:

          T.

  Case 3.1.
          (IMPLIES
		 (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CADR Y) (CAR Y))
		      (EQUAL (DELETE A (ADDTOLIST2 Z (CDR Y)))
			     (ADDTOLIST2 Z (DELETE A (CDR Y))))
		      (PLISTP (CDR Y))
		      (ORDERED2 (CDR Y))
		      (LESSP Z A)
		      (EQUAL A (CAR Y))
		      (LESSP Z (CAR Y)))
		 (EQUAL (DELETE A
				(CONS (CAR Y) (ADDTOLIST2 Z (CDR Y))))
			(ADDTOLIST2 Z (CDR Y)))),

    which again simplifies, rewriting with CDR-CONS and CAR-CONS, and
    expanding the definition of DELETE, to:

          T.

Case 2. (IMPLIES (AND (LISTP Y)
		      (NOT (LISTP (CDR Y)))
		      (PLISTP Y)
		      (ORDERED2 Y)
		      (LESSP Z A))
		 (EQUAL (DELETE A (ADDTOLIST2 Z Y))
			(ADDTOLIST2 Z (DELETE A Y)))),

  which simplifies, expanding the functions PLISTP, ORDERED2,
  ADDTOLIST2, and DELETE, to the following four new formulas:

  Case 2.4.
          (IMPLIES
	      (AND (LISTP Y)
		   (NOT (LISTP (CDR Y)))
		   (PLISTP (CDR Y))
		   (LESSP Z A)
		   (NOT (EQUAL A (CAR Y)))
		   ( LEQ (CAR Y) Z))
	      (EQUAL (DELETE A (CONS Z Y))
		     (ADDTOLIST2 Z
				 (CONS (CAR Y) (DELETE A (CDR Y)))))),

    which again simplifies, rewriting with DELETE-NON-MEMBER,
    CDR-CONS, and CAR-CONS, and unfolding the definitions of MEMBER,
    DELETE, and ADDTOLIST2, to the following two new formulas:

    Case 2.4.2.
            (IMPLIES
		    (AND (LISTP Y)
			 (NOT (LISTP (CDR Y)))
			 (PLISTP (CDR Y))
			 (LESSP Z A)
			 (NOT (EQUAL A (CAR Y)))
			 ( LEQ (CAR Y) Z)
			 (NOT (EQUAL A Z)))
		    (EQUAL (CONS Z Y)
			   (CONS Z
				 (CONS (CAR Y) (DELETE A (CDR Y)))))).

      But this simplifies again, rewriting with the lemmas CAR-CONS,
      CDR-CONS, and CONS-EQUAL, to:

            (IMPLIES (AND (LISTP Y)
			  (NOT (LISTP (CDR Y)))
			  (PLISTP (CDR Y))
			  (LESSP Z A)
			  (NOT (EQUAL A (CAR Y)))
			  ( LEQ (CAR Y) Z)
			  (NOT (EQUAL A Z)))
		     (EQUAL Y
			    (CONS (CAR Y) (DELETE A (CDR Y))))),

      which further simplifies, applying the lemmas DELETE-NON-MEMBER,
      CAR-CONS, and CDR-CONS, and unfolding the definitions of PLISTP,
      MEMBER, LISTP, and EQUAL, to:

            T.

    Case 2.4.1.
            (IMPLIES
		    (AND (LISTP Y)
			 (NOT (LISTP (CDR Y)))
			 (PLISTP (CDR Y))
			 (LESSP Z A)
			 (NOT (EQUAL A (CAR Y)))
			 ( LEQ (CAR Y) Z)
			 (EQUAL A Z))
		    (EQUAL Y
			   (CONS Z
				 (CONS (CAR Y) (DELETE A (CDR Y)))))).

      But this simplifies again, using linear arithmetic, to:

            T.

  Case 2.3.
          (IMPLIES
	      (AND (LISTP Y)
		   (NOT (LISTP (CDR Y)))
		   (PLISTP (CDR Y))
		   (LESSP Z A)
		   (NOT (EQUAL A (CAR Y)))
		   (LESSP Z (CAR Y)))
	      (EQUAL (DELETE A
			     (CONS (CAR Y) (ADDTOLIST2 Z (CDR Y))))
		     (ADDTOLIST2 Z
				 (CONS (CAR Y) (DELETE A (CDR Y)))))).

    However this again simplifies, applying CDR-CONS, CAR-CONS, and
    CONS-EQUAL, and unfolding DELETE and ADDTOLIST2, to the new goal:

          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(PLISTP (CDR Y))
			(LESSP Z A)
			(NOT (EQUAL A (CAR Y)))
			(LESSP Z (CAR Y)))
		   (EQUAL (DELETE A (ADDTOLIST2 Z (CDR Y)))
			  (ADDTOLIST2 Z (DELETE A (CDR Y))))).

    However this simplifies further, rewriting with DELETE-NON-MEMBER,
    CDR-CONS, and CAR-CONS, and expanding PLISTP, LISTP, ADDTOLIST2,
    MEMBER, and DELETE, to:

          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(EQUAL (CDR Y) NIL)
			(LESSP Z A)
			(NOT (EQUAL A (CAR Y)))
			(LESSP Z (CAR Y)))
		   (NOT (EQUAL A Z))).

    But this again simplifies, using linear arithmetic, to:

          T.

  Case 2.2.
          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(PLISTP (CDR Y))
			(LESSP Z A)
			(EQUAL A (CAR Y))
			( LEQ (CAR Y) Z))
		   (EQUAL (DELETE A (CONS Z Y))
			  (ADDTOLIST2 Z (CDR Y)))).

    Of course, this again simplifies, obviously, to:

          T.

  Case 2.1.
          (IMPLIES
		 (AND (LISTP Y)
		      (NOT (LISTP (CDR Y)))
		      (PLISTP (CDR Y))
		      (LESSP Z A)
		      (EQUAL A (CAR Y))
		      (LESSP Z (CAR Y)))
		 (EQUAL (DELETE A
				(CONS (CAR Y) (ADDTOLIST2 Z (CDR Y))))
			(ADDTOLIST2 Z (CDR Y)))).

    However this again simplifies, rewriting with CDR-CONS and
    CAR-CONS, and expanding the function DELETE, to:

          T.

Case 1. (IMPLIES (AND (NOT (LISTP Y))
		      (PLISTP Y)
		      (ORDERED2 Y)
		      (LESSP Z A))
		 (EQUAL (DELETE A (ADDTOLIST2 Z Y))
			(ADDTOLIST2 Z (DELETE A Y)))),

  which simplifies, rewriting with the lemmas DELETE-NON-MEMBER,
  CDR-CONS, and CAR-CONS, and unfolding the functions PLISTP,
  ORDERED2, LISTP, ADDTOLIST2, MEMBER, and DELETE, to:

        (IMPLIES (AND (NOT (LISTP Y))
		      (EQUAL Y NIL)
		      (LESSP Z A))
		 (NOT (EQUAL A Z))),

  which again simplifies, using linear arithmetic, to:

        T.


     That finishes the proof of *1.1, which, consequently, finishes
the proof of *1.  Q.E.D.


[ 23.5479817 1.62301432 ]

SORT2-DELETE-CONS 


(PROVE-LEMMA SORT2-DELETE
	     (REWRITE)
	     (EQUAL (SORT2 (DELETE X L))
		    (DELETE X (SORT2 L))))

     Give the conjecture the name *1.


     We will appeal to induction.  There are two plausible inductions.
However, they merge into one likely candidate induction.  We will
induct according to the following scheme:
      (AND (IMPLIES (AND (LISTP L) (EQUAL X (CAR L)))
		    (P X L))
	   (IMPLIES (AND (LISTP L)
			 (NOT (EQUAL X (CAR L)))
			 (P X (CDR L)))
		    (P X L))
	   (IMPLIES (NOT (LISTP L)) (P X L))).
Linear arithmetic and the lemma CDR-LESSP can be used to establish
that the measure (COUNT L) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme produces three new conjectures:

Case 3. (IMPLIES (AND (LISTP L) (EQUAL X (CAR L)))
		 (EQUAL (SORT2 (DELETE X L))
			(DELETE X (SORT2 L)))).

  This simplifies, appealing to the lemmas SORT2-GEN-1 and
  DELETE-ADDTOLIST2, and expanding DELETE and SORT2, to:

        T.

Case 2. (IMPLIES (AND (LISTP L)
		      (NOT (EQUAL X (CAR L)))
		      (EQUAL (SORT2 (DELETE X (CDR L)))
			     (DELETE X (SORT2 (CDR L)))))
		 (EQUAL (SORT2 (DELETE X L))
			(DELETE X (SORT2 L)))).

  This simplifies, applying the lemmas ADDTOLIST2-DELETE, SORT2-GEN-1,
  SORT2-GEN-2, CDR-CONS, and CAR-CONS, and expanding the definitions
  of DELETE and SORT2, to:

        T.

Case 1. (IMPLIES (NOT (LISTP L))
		 (EQUAL (SORT2 (DELETE X L))
			(DELETE X (SORT2 L)))),

  which simplifies, rewriting with DELETE-NON-MEMBER, and opening up
  MEMBER, SORT2, LISTP, and EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 2.42298177 0.216015626 ]

SORT2-DELETE 


(PROVE-LEMMA DSORT-SORT2
	     (REWRITE)
	     (EQUAL (DSORT X) (SORT2 X)))

     Give the conjecture the name *1.


     We will try to prove it by induction.  Two inductions are
suggested by terms in the conjecture, both of which are unflawed.  So
we will choose the one suggested by the largest number of
nonprimitive recursive functions.  We will induct according to the
following scheme:
      (AND (IMPLIES (NLISTP X) (P X))
	   (IMPLIES (AND (NOT (NLISTP X))
			 (P (DELETE (MAXIMUM X) X)))
		    (P X))).
The lemmas LESSP-DELETE-REWRITE and MEMBER-MAXIMUM and the definition
of NLISTP establish that the measure (COUNT X) decreases according to
the well-founded relation LESSP in each induction step of the scheme.
The above induction scheme leads to the following two new goals:

Case 2. (IMPLIES (NLISTP X)
		 (EQUAL (DSORT X) (SORT2 X))),

  which simplifies, unfolding the definitions of NLISTP, DSORT, SORT2,
  and EQUAL, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP X))
		      (EQUAL (DSORT (DELETE (MAXIMUM X) X))
			     (SORT2 (DELETE (MAXIMUM X) X))))
		 (EQUAL (DSORT X) (SORT2 X))).

  This simplifies, applying SORT2-DELETE and SORT2-DELETE-CONS, and
  expanding the functions NLISTP and DSORT, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.62498373 0.167008463 ]

DSORT-SORT2 


(PROVE-LEMMA COUNT-LIST-SORT2 NIL
	     (EQUAL (COUNT-LIST A (SORT2 L))
		    (COUNT-LIST A L)))

     Call the conjecture *1.


     Perhaps we can prove it by induction.  There are two plausible
inductions.  However, they merge into one likely candidate induction.
We will induct according to the following scheme:
      (AND (IMPLIES (NLISTP L) (P A L))
	   (IMPLIES (AND (NOT (NLISTP L)) (P A (CDR L)))
		    (P A L))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP establish that the measure (COUNT L) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme produces two new formulas:

Case 2. (IMPLIES (NLISTP L)
		 (EQUAL (COUNT-LIST A (SORT2 L))
			(COUNT-LIST A L))).

  This simplifies, expanding the definitions of NLISTP, SORT2, LISTP,
  COUNT-LIST, and EQUAL, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP L))
		      (EQUAL (COUNT-LIST A (SORT2 (CDR L)))
			     (COUNT-LIST A (CDR L))))
		 (EQUAL (COUNT-LIST A (SORT2 L))
			(COUNT-LIST A L))),

  which simplifies, opening up the definitions of NLISTP, SORT2, and
  COUNT-LIST, to the following two new formulas:

  Case 1.2.
          (IMPLIES
	      (AND (LISTP L)
		   (EQUAL (COUNT-LIST A (SORT2 (CDR L)))
			  (COUNT-LIST A (CDR L)))
		   (NOT (EQUAL A (CAR L))))
	      (EQUAL (COUNT-LIST A
				 (ADDTOLIST2 (CAR L) (SORT2 (CDR L))))
		     (COUNT-LIST A (CDR L)))).

    Applying the lemma CAR-CDR-ELIM, replace L by (CONS Z X) to
    eliminate (CDR L) and (CAR L).  We would thus like to prove:

          (IMPLIES (AND (EQUAL (COUNT-LIST A (SORT2 X))
			       (COUNT-LIST A X))
			(NOT (EQUAL A Z)))
		   (EQUAL (COUNT-LIST A
				      (ADDTOLIST2 Z (SORT2 X)))
			  (COUNT-LIST A X))).

    We use the above equality hypothesis by substituting
    (COUNT-LIST A (SORT2 X)) for (COUNT-LIST A X) and throwing away
    the equality.  We thus obtain:

          (IMPLIES (NOT (EQUAL A Z))
		   (EQUAL (COUNT-LIST A
				      (ADDTOLIST2 Z (SORT2 X)))
			  (COUNT-LIST A (SORT2 X)))),

    which we generalize by replacing (SORT2 X) by Y.  We restrict the
    new variable by appealing to SORT2-GEN.  We must thus prove:

          (IMPLIES (AND (AND (PLISTP Y) (ORDERED2 Y))
			(NOT (EQUAL A Z)))
		   (EQUAL (COUNT-LIST A (ADDTOLIST2 Z Y))
			  (COUNT-LIST A Y))).

    But this further simplifies, unfolding the definition of AND, to:

          (IMPLIES (AND (PLISTP Y)
			(ORDERED2 Y)
			(NOT (EQUAL A Z)))
		   (EQUAL (COUNT-LIST A (ADDTOLIST2 Z Y))
			  (COUNT-LIST A Y))),

    which we will finally name *1.1.

  Case 1.1.
          (IMPLIES
	      (AND (LISTP L)
		   (EQUAL (COUNT-LIST A (SORT2 (CDR L)))
			  (COUNT-LIST A (CDR L)))
		   (EQUAL A (CAR L)))
	      (EQUAL (COUNT-LIST A
				 (ADDTOLIST2 (CAR L) (SORT2 (CDR L))))
		     (ADD1 (COUNT-LIST A (CDR L))))),

    which we again simplify, obviously, to:

          (IMPLIES
	      (AND (LISTP L)
		   (EQUAL (COUNT-LIST (CAR L) (SORT2 (CDR L)))
			  (COUNT-LIST (CAR L) (CDR L))))
	      (EQUAL (COUNT-LIST (CAR L)
				 (ADDTOLIST2 (CAR L) (SORT2 (CDR L))))
		     (ADD1 (COUNT-LIST (CAR L) (CDR L))))).

    Appealing to the lemma CAR-CDR-ELIM, we now replace L by
    (CONS X Z) to eliminate (CAR L) and (CDR L).  We would thus like
    to prove the new formula:

          (IMPLIES (EQUAL (COUNT-LIST X (SORT2 Z))
			  (COUNT-LIST X Z))
		   (EQUAL (COUNT-LIST X
				      (ADDTOLIST2 X (SORT2 Z)))
			  (ADD1 (COUNT-LIST X Z)))).

    We now use the above equality hypothesis by substituting
    (COUNT-LIST X (SORT2 Z)) for (COUNT-LIST X Z) and throwing away
    the equality.  We would thus like to prove:

          (EQUAL (COUNT-LIST X
			     (ADDTOLIST2 X (SORT2 Z)))
		 (ADD1 (COUNT-LIST X (SORT2 Z)))),

    which we generalize by replacing (SORT2 Z) by Y.  We restrict the
    new variable by appealing to SORT2-GEN.  The result is the new
    conjecture:

          (IMPLIES (AND (PLISTP Y) (ORDERED2 Y))
		   (EQUAL (COUNT-LIST X (ADDTOLIST2 X Y))
			  (ADD1 (COUNT-LIST X Y)))),

    which we further simplify, unfolding the definition of AND, to
    the formula:

          (IMPLIES (AND (PLISTP Y) (ORDERED2 Y))
		   (EQUAL (COUNT-LIST X (ADDTOLIST2 X Y))
			  (ADD1 (COUNT-LIST X Y)))),

    which we will finally name *1.2.


     We will try to prove it by induction.  The recursive terms in
the conjecture suggest four inductions.  However, they merge into one
likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (LISTP Y)
			 (LISTP (CDR Y))
			 (LESSP (CAR Y) (CADR Y)))
		    (P X Y))
	   (IMPLIES (AND (LISTP Y)
			 (LISTP (CDR Y))
			 ( LEQ (CADR Y) (CAR Y))
			 (P X (CDR Y)))
		    (P X Y))
	   (IMPLIES (AND (LISTP Y) (NOT (LISTP (CDR Y))))
		    (P X Y))
	   (IMPLIES (NOT (LISTP Y)) (P X Y))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
generates the following six new formulas:

Case 6. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      (LESSP (CAR Y) (CADR Y))
		      (PLISTP Y)
		      (ORDERED2 Y))
		 (EQUAL (COUNT-LIST X (ADDTOLIST2 X Y))
			(ADD1 (COUNT-LIST X Y)))).

  This simplifies, opening up the definitions of PLISTP and ORDERED2,
  to:

        T.

Case 5. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CADR Y) (CAR Y))
		      (NOT (PLISTP (CDR Y)))
		      (PLISTP Y)
		      (ORDERED2 Y))
		 (EQUAL (COUNT-LIST X (ADDTOLIST2 X Y))
			(ADD1 (COUNT-LIST X Y)))).

  This simplifies, unfolding the definition of PLISTP, to:

        T.

Case 4. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CADR Y) (CAR Y))
		      (NOT (ORDERED2 (CDR Y)))
		      (PLISTP Y)
		      (ORDERED2 Y))
		 (EQUAL (COUNT-LIST X (ADDTOLIST2 X Y))
			(ADD1 (COUNT-LIST X Y)))),

  which simplifies, expanding the functions PLISTP and ORDERED2, to:

        T.

Case 3. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CADR Y) (CAR Y))
		      (EQUAL (COUNT-LIST X (ADDTOLIST2 X (CDR Y)))
			     (ADD1 (COUNT-LIST X (CDR Y))))
		      (PLISTP Y)
		      (ORDERED2 Y))
		 (EQUAL (COUNT-LIST X (ADDTOLIST2 X Y))
			(ADD1 (COUNT-LIST X Y)))),

  which we simplify, opening up the definitions of PLISTP, ORDERED2,
  ADDTOLIST2, and COUNT-LIST, to four new goals:

  Case 3.4.
          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CADR Y) (CAR Y))
			(EQUAL (COUNT-LIST X (ADDTOLIST2 X (CDR Y)))
			       (ADD1 (COUNT-LIST X (CDR Y))))
			(PLISTP (CDR Y))
			(ORDERED2 (CDR Y))
			(NOT (EQUAL X (CAR Y)))
			( LEQ (CAR Y) X))
		   (EQUAL (COUNT-LIST X (CONS X Y))
			  (ADD1 (COUNT-LIST X (CDR Y))))),

    which we again simplify, applying CDR-CONS and CAR-CONS, and
    expanding COUNT-LIST, to:

          T.

  Case 3.3.
          (IMPLIES
	     (AND (LISTP Y)
		  (LISTP (CDR Y))
		  ( LEQ (CADR Y) (CAR Y))
		  (EQUAL (COUNT-LIST X (ADDTOLIST2 X (CDR Y)))
			 (ADD1 (COUNT-LIST X (CDR Y))))
		  (PLISTP (CDR Y))
		  (ORDERED2 (CDR Y))
		  (NOT (EQUAL X (CAR Y)))
		  (LESSP X (CAR Y)))
	     (EQUAL (COUNT-LIST X
				(CONS (CAR Y) (ADDTOLIST2 X (CDR Y))))
		    (ADD1 (COUNT-LIST X (CDR Y))))),

    which again simplifies, rewriting with CDR-CONS and CAR-CONS, and
    opening up the definition of COUNT-LIST, to:

          T.

  Case 3.2.
          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CADR Y) (CAR Y))
			(EQUAL (COUNT-LIST X (ADDTOLIST2 X (CDR Y)))
			       (ADD1 (COUNT-LIST X (CDR Y))))
			(PLISTP (CDR Y))
			(ORDERED2 (CDR Y))
			(EQUAL X (CAR Y))
			( LEQ (CAR Y) X))
		   (EQUAL (COUNT-LIST X (CONS X Y))
			  (ADD1 (ADD1 (COUNT-LIST X (CDR Y)))))),

    which again simplifies, rewriting with the lemmas CONS-CAR-CDR,
    CDR-CONS, and CAR-CONS, and expanding the definitions of
    ADDTOLIST2 and COUNT-LIST, to:

          T.

  Case 3.1.
          (IMPLIES
	     (AND (LISTP Y)
		  (LISTP (CDR Y))
		  ( LEQ (CADR Y) (CAR Y))
		  (EQUAL (COUNT-LIST X (ADDTOLIST2 X (CDR Y)))
			 (ADD1 (COUNT-LIST X (CDR Y))))
		  (PLISTP (CDR Y))
		  (ORDERED2 (CDR Y))
		  (EQUAL X (CAR Y))
		  (LESSP X (CAR Y)))
	     (EQUAL (COUNT-LIST X
				(CONS (CAR Y) (ADDTOLIST2 X (CDR Y))))
		    (ADD1 (ADD1 (COUNT-LIST X (CDR Y)))))).

    This again simplifies, using linear arithmetic, to:

          T.

Case 2. (IMPLIES (AND (LISTP Y)
		      (NOT (LISTP (CDR Y)))
		      (PLISTP Y)
		      (ORDERED2 Y))
		 (EQUAL (COUNT-LIST X (ADDTOLIST2 X Y))
			(ADD1 (COUNT-LIST X Y)))),

  which simplifies, expanding the functions PLISTP, ORDERED2,
  ADDTOLIST2, and COUNT-LIST, to four new conjectures:

  Case 2.4.
          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(PLISTP (CDR Y))
			(NOT (EQUAL X (CAR Y)))
			( LEQ (CAR Y) X))
		   (EQUAL (COUNT-LIST X (CONS X Y))
			  (ADD1 (COUNT-LIST X (CDR Y))))),

    which we again simplify, applying CDR-CONS and CAR-CONS, and
    opening up the function COUNT-LIST, to:

          T.

  Case 2.3.
          (IMPLIES
	     (AND (LISTP Y)
		  (NOT (LISTP (CDR Y)))
		  (PLISTP (CDR Y))
		  (NOT (EQUAL X (CAR Y)))
		  (LESSP X (CAR Y)))
	     (EQUAL (COUNT-LIST X
				(CONS (CAR Y) (ADDTOLIST2 X (CDR Y))))
		    (ADD1 (COUNT-LIST X (CDR Y))))).

    However this again simplifies, applying CDR-CONS and CAR-CONS,
    and unfolding COUNT-LIST, to:

          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(PLISTP (CDR Y))
			(NOT (EQUAL X (CAR Y)))
			(LESSP X (CAR Y)))
		   (EQUAL (COUNT-LIST X (ADDTOLIST2 X (CDR Y)))
			  (ADD1 (COUNT-LIST X (CDR Y))))),

    which further simplifies, rewriting with CDR-CONS and CAR-CONS,
    and expanding the functions PLISTP, LISTP, ADDTOLIST2, COUNT-LIST,
    ADD1, and EQUAL, to:

          T.

  Case 2.2.
          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(PLISTP (CDR Y))
			(EQUAL X (CAR Y))
			( LEQ (CAR Y) X))
		   (EQUAL (COUNT-LIST X (CONS X Y))
			  (ADD1 (ADD1 (COUNT-LIST X (CDR Y)))))).

    However this simplifies again, rewriting with the lemmas CDR-CONS,
    CAR-CONS, and ADD1-EQUAL, and unfolding the functions COUNT-LIST,
    ADD1, and NUMBERP, to the formula:

          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(PLISTP (CDR Y))
			( LEQ (CAR Y) (CAR Y)))
		   (EQUAL (COUNT-LIST (CAR Y) Y) 1)).

    However this further simplifies, opening up the definition of
    PLISTP, to:

          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(EQUAL (CDR Y) NIL)
			( LEQ (CAR Y) (CAR Y)))
		   (EQUAL (COUNT-LIST (CAR Y) Y) 1)).

    This simplifies again, opening up LISTP, to:

          (IMPLIES (AND (LISTP Y)
			(EQUAL (CDR Y) NIL)
			( LEQ (CAR Y) (CAR Y)))
		   (EQUAL (COUNT-LIST (CAR Y) Y) 1)).

    Appealing to the lemma CAR-CDR-ELIM, we now replace Y by
    (CONS V Z) to eliminate (CDR Y) and (CAR Y).  We must thus prove:

          (IMPLIES (AND (EQUAL Z NIL) ( LEQ V V))
		   (EQUAL (COUNT-LIST V (CONS V Z)) 1)).

    However this simplifies finally, applying CDR-CONS and CAR-CONS,
    and unfolding the definitions of COUNT-LIST, LISTP, ADD1, and
    EQUAL, to:

          T.

  Case 2.1.
          (IMPLIES
	     (AND (LISTP Y)
		  (NOT (LISTP (CDR Y)))
		  (PLISTP (CDR Y))
		  (EQUAL X (CAR Y))
		  (LESSP X (CAR Y)))
	     (EQUAL (COUNT-LIST X
				(CONS (CAR Y) (ADDTOLIST2 X (CDR Y))))
		    (ADD1 (ADD1 (COUNT-LIST X (CDR Y)))))).

    This simplifies again, using linear arithmetic, to:

          T.

Case 1. (IMPLIES (AND (NOT (LISTP Y))
		      (PLISTP Y)
		      (ORDERED2 Y))
		 (EQUAL (COUNT-LIST X (ADDTOLIST2 X Y))
			(ADD1 (COUNT-LIST X Y)))),

  which simplifies, rewriting with the lemmas CDR-CONS and CAR-CONS,
  and opening up the functions PLISTP, ORDERED2, LISTP, ADDTOLIST2,
  COUNT-LIST, ADD1, and EQUAL, to:

        T.


     That finishes the proof of *1.2.


     So we now return to:

      (IMPLIES (AND (PLISTP Y)
		    (ORDERED2 Y)
		    (NOT (EQUAL A Z)))
	       (EQUAL (COUNT-LIST A (ADDTOLIST2 Z Y))
		      (COUNT-LIST A Y))),

which is formula *1.1 above.  We will appeal to induction.  The
recursive terms in the conjecture suggest four inductions.  However,
they merge into one likely candidate induction.  We will induct
according to the following scheme:
      (AND (IMPLIES (AND (LISTP Y)
			 (LISTP (CDR Y))
			 (LESSP (CAR Y) (CADR Y)))
		    (P A Z Y))
	   (IMPLIES (AND (LISTP Y)
			 (LISTP (CDR Y))
			 ( LEQ (CADR Y) (CAR Y))
			 (P A Z (CDR Y)))
		    (P A Z Y))
	   (IMPLIES (AND (LISTP Y) (NOT (LISTP (CDR Y))))
		    (P A Z Y))
	   (IMPLIES (NOT (LISTP Y)) (P A Z Y))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme leads
to the following six new goals:

Case 6. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      (LESSP (CAR Y) (CADR Y))
		      (PLISTP Y)
		      (ORDERED2 Y)
		      (NOT (EQUAL A Z)))
		 (EQUAL (COUNT-LIST A (ADDTOLIST2 Z Y))
			(COUNT-LIST A Y))),

  which simplifies, opening up PLISTP and ORDERED2, to:

        T.

Case 5. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CADR Y) (CAR Y))
		      (NOT (PLISTP (CDR Y)))
		      (PLISTP Y)
		      (ORDERED2 Y)
		      (NOT (EQUAL A Z)))
		 (EQUAL (COUNT-LIST A (ADDTOLIST2 Z Y))
			(COUNT-LIST A Y))).

  This simplifies, unfolding the function PLISTP, to:

        T.

Case 4. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CADR Y) (CAR Y))
		      (NOT (ORDERED2 (CDR Y)))
		      (PLISTP Y)
		      (ORDERED2 Y)
		      (NOT (EQUAL A Z)))
		 (EQUAL (COUNT-LIST A (ADDTOLIST2 Z Y))
			(COUNT-LIST A Y))).

  This simplifies, unfolding the definitions of PLISTP and ORDERED2,
  to:

        T.

Case 3. (IMPLIES (AND (LISTP Y)
		      (LISTP (CDR Y))
		      ( LEQ (CADR Y) (CAR Y))
		      (EQUAL (COUNT-LIST A (ADDTOLIST2 Z (CDR Y)))
			     (COUNT-LIST A (CDR Y)))
		      (PLISTP Y)
		      (ORDERED2 Y)
		      (NOT (EQUAL A Z)))
		 (EQUAL (COUNT-LIST A (ADDTOLIST2 Z Y))
			(COUNT-LIST A Y))).

  This simplifies, unfolding the functions PLISTP, ORDERED2,
  ADDTOLIST2, and COUNT-LIST, to four new formulas:

  Case 3.4.
          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CADR Y) (CAR Y))
			(EQUAL (COUNT-LIST A (ADDTOLIST2 Z (CDR Y)))
			       (COUNT-LIST A (CDR Y)))
			(PLISTP (CDR Y))
			(ORDERED2 (CDR Y))
			(NOT (EQUAL A Z))
			(NOT (EQUAL A (CAR Y)))
			( LEQ (CAR Y) Z))
		   (EQUAL (COUNT-LIST A (CONS Z Y))
			  (COUNT-LIST A (CDR Y)))).

    This simplifies again, rewriting with CDR-CONS and CAR-CONS, and
    opening up the definition of COUNT-LIST, to:

          T.

  Case 3.3.
          (IMPLIES
	     (AND (LISTP Y)
		  (LISTP (CDR Y))
		  ( LEQ (CADR Y) (CAR Y))
		  (EQUAL (COUNT-LIST A (ADDTOLIST2 Z (CDR Y)))
			 (COUNT-LIST A (CDR Y)))
		  (PLISTP (CDR Y))
		  (ORDERED2 (CDR Y))
		  (NOT (EQUAL A Z))
		  (NOT (EQUAL A (CAR Y)))
		  (LESSP Z (CAR Y)))
	     (EQUAL (COUNT-LIST A
				(CONS (CAR Y) (ADDTOLIST2 Z (CDR Y))))
		    (COUNT-LIST A (CDR Y)))).

    But this again simplifies, rewriting with CDR-CONS and CAR-CONS,
    and unfolding the function COUNT-LIST, to:

          T.

  Case 3.2.
          (IMPLIES (AND (LISTP Y)
			(LISTP (CDR Y))
			( LEQ (CADR Y) (CAR Y))
			(EQUAL (COUNT-LIST A (ADDTOLIST2 Z (CDR Y)))
			       (COUNT-LIST A (CDR Y)))
			(PLISTP (CDR Y))
			(ORDERED2 (CDR Y))
			(NOT (EQUAL A Z))
			(EQUAL A (CAR Y))
			( LEQ (CAR Y) Z))
		   (EQUAL (COUNT-LIST A (CONS Z Y))
			  (ADD1 (COUNT-LIST A (CDR Y))))),

    which we again simplify, rewriting with CDR-CONS and CAR-CONS,
    and unfolding the definition of COUNT-LIST, to:

          T.

  Case 3.1.
          (IMPLIES
	     (AND (LISTP Y)
		  (LISTP (CDR Y))
		  ( LEQ (CADR Y) (CAR Y))
		  (EQUAL (COUNT-LIST A (ADDTOLIST2 Z (CDR Y)))
			 (COUNT-LIST A (CDR Y)))
		  (PLISTP (CDR Y))
		  (ORDERED2 (CDR Y))
		  (NOT (EQUAL A Z))
		  (EQUAL A (CAR Y))
		  (LESSP Z (CAR Y)))
	     (EQUAL (COUNT-LIST A
				(CONS (CAR Y) (ADDTOLIST2 Z (CDR Y))))
		    (ADD1 (COUNT-LIST A (CDR Y))))),

    which again simplifies, applying the lemmas CDR-CONS and CAR-CONS,
    and expanding the function COUNT-LIST, to:

          T.

Case 2. (IMPLIES (AND (LISTP Y)
		      (NOT (LISTP (CDR Y)))
		      (PLISTP Y)
		      (ORDERED2 Y)
		      (NOT (EQUAL A Z)))
		 (EQUAL (COUNT-LIST A (ADDTOLIST2 Z Y))
			(COUNT-LIST A Y))),

  which simplifies, unfolding the definitions of PLISTP, ORDERED2,
  ADDTOLIST2, and COUNT-LIST, to the following four new conjectures:

  Case 2.4.
          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(PLISTP (CDR Y))
			(NOT (EQUAL A Z))
			(NOT (EQUAL A (CAR Y)))
			( LEQ (CAR Y) Z))
		   (EQUAL (COUNT-LIST A (CONS Z Y))
			  (COUNT-LIST A (CDR Y)))).

    However this again simplifies, rewriting with CDR-CONS and
    CAR-CONS, and expanding COUNT-LIST, to:

          T.

  Case 2.3.
          (IMPLIES
	     (AND (LISTP Y)
		  (NOT (LISTP (CDR Y)))
		  (PLISTP (CDR Y))
		  (NOT (EQUAL A Z))
		  (NOT (EQUAL A (CAR Y)))
		  (LESSP Z (CAR Y)))
	     (EQUAL (COUNT-LIST A
				(CONS (CAR Y) (ADDTOLIST2 Z (CDR Y))))
		    (COUNT-LIST A (CDR Y)))).

    However this again simplifies, applying CDR-CONS and CAR-CONS,
    and opening up the definition of COUNT-LIST, to:

          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(PLISTP (CDR Y))
			(NOT (EQUAL A Z))
			(NOT (EQUAL A (CAR Y)))
			(LESSP Z (CAR Y)))
		   (EQUAL (COUNT-LIST A (ADDTOLIST2 Z (CDR Y)))
			  (COUNT-LIST A (CDR Y)))),

    which further simplifies, rewriting with the lemmas CDR-CONS and
    CAR-CONS, and unfolding PLISTP, LISTP, ADDTOLIST2, COUNT-LIST,
    and EQUAL, to:

          T.

  Case 2.2.
          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(PLISTP (CDR Y))
			(NOT (EQUAL A Z))
			(EQUAL A (CAR Y))
			( LEQ (CAR Y) Z))
		   (EQUAL (COUNT-LIST A (CONS Z Y))
			  (ADD1 (COUNT-LIST A (CDR Y))))),

    which again simplifies, rewriting with CDR-CONS and CAR-CONS, and
    expanding COUNT-LIST and ADD1, to:

          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(PLISTP (CDR Y))
			(NOT (EQUAL (CAR Y) Z))
			( LEQ (CAR Y) Z))
		   (EQUAL (COUNT-LIST (CAR Y) Y) 1)),

    which we further simplify, expanding the function PLISTP, to the
    new conjecture:

          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(EQUAL (CDR Y) NIL)
			(NOT (EQUAL (CAR Y) Z))
			( LEQ (CAR Y) Z))
		   (EQUAL (COUNT-LIST (CAR Y) Y) 1)).

    But this simplifies again, opening up LISTP, to:

          (IMPLIES (AND (LISTP Y)
			(EQUAL (CDR Y) NIL)
			(NOT (EQUAL (CAR Y) Z))
			( LEQ (CAR Y) Z))
		   (EQUAL (COUNT-LIST (CAR Y) Y) 1)).

    Appealing to the lemma CAR-CDR-ELIM, replace Y by (CONS V X) to
    eliminate (CDR Y) and (CAR Y).  We would thus like to prove:

          (IMPLIES (AND (EQUAL X NIL)
			(NOT (EQUAL V Z))
			( LEQ V Z))
		   (EQUAL (COUNT-LIST V (CONS V X)) 1)),

    which finally simplifies, applying the lemmas CDR-CONS and
    CAR-CONS, and opening up COUNT-LIST, LISTP, ADD1, and EQUAL, to:

          T.

  Case 2.1.
          (IMPLIES
	     (AND (LISTP Y)
		  (NOT (LISTP (CDR Y)))
		  (PLISTP (CDR Y))
		  (NOT (EQUAL A Z))
		  (EQUAL A (CAR Y))
		  (LESSP Z (CAR Y)))
	     (EQUAL (COUNT-LIST A
				(CONS (CAR Y) (ADDTOLIST2 Z (CDR Y))))
		    (ADD1 (COUNT-LIST A (CDR Y))))).

    However this simplifies again, applying the lemmas CDR-CONS,
    CAR-CONS, and ADD1-EQUAL, and unfolding COUNT-LIST, ADD1, and
    NUMBERP, to:

          (IMPLIES (AND (LISTP Y)
			(NOT (LISTP (CDR Y)))
			(PLISTP (CDR Y))
			(NOT (EQUAL (CAR Y) Z))
			(LESSP Z (CAR Y)))
		   (EQUAL (COUNT-LIST (CAR Y)
				      (ADDTOLIST2 Z (CDR Y)))
			  0)).

    However this further simplifies, applying CDR-CONS and CAR-CONS,
    and expanding the functions PLISTP, LISTP, ADDTOLIST2, COUNT-LIST,
    and EQUAL, to:

          T.

Case 1. (IMPLIES (AND (NOT (LISTP Y))
		      (PLISTP Y)
		      (ORDERED2 Y)
		      (NOT (EQUAL A Z)))
		 (EQUAL (COUNT-LIST A (ADDTOLIST2 Z Y))
			(COUNT-LIST A Y))).

  This simplifies, applying CDR-CONS and CAR-CONS, and expanding the
  definitions of PLISTP, ORDERED2, LISTP, ADDTOLIST2, COUNT-LIST, and
  EQUAL, to:

        T.


     That finishes the proof of *1.1, which, consequently, finishes
the proof of *1.  Q.E.D.


[ 22.7530274 2.3549642 ]

COUNT-LIST-SORT2 


(DEFN SIGMA
      (M N)
      (IF (LESSP M N)
	  (PLUS N (SIGMA M (SUB1 N)))
	  0.)
      NIL)
     Linear arithmetic and the lemmas COUNT-NUMBERP and
COUNT-NOT-LESSP can be used to prove that the measure (COUNT N)
decreases according to the well-founded relation LESSP in each
recursive call.  Hence, SIGMA is accepted under the principle of
definition.  Observe that (NUMBERP (SIGMA M N)) is a theorem.




[ 0.335009765 0.05 ]

SIGMA 


(PROVE-LEMMA DIFFERENCE-1
	     (REWRITE)
	     (EQUAL (DIFFERENCE X 1.) (SUB1 X)))
This conjecture simplifies, using linear arithmetic, to:

      (IMPLIES (LESSP X 1)
	       (EQUAL (DIFFERENCE X 1) (SUB1 X))).

However this again simplifies, using linear arithmetic and applying
the lemma DIFFERENCE-0, to:

      (IMPLIES (LESSP X 1)
	       (EQUAL 0 (SUB1 X))).

Appealing to the lemma SUB1-ELIM, we now replace X by (ADD1 Z) to
eliminate (SUB1 X).  We use the type restriction lemma noted when
SUB1 was introduced to constrain the new variable.  We would thus
like to prove three new goals:

Case 3. (IMPLIES (AND (EQUAL X 0) (LESSP X 1))
		 (EQUAL 0 (SUB1 X))).

  However this simplifies further, unfolding LESSP, SUB1, and EQUAL,
  to:

        T.

Case 2. (IMPLIES (AND (NOT (NUMBERP X)) (LESSP X 1))
		 (EQUAL 0 (SUB1 X))).

  But this further simplifies, rewriting with SUB1-NNUMBERP, and
  expanding NUMBERP, EQUAL, and LESSP, to:

        T.

Case 1. (IMPLIES (AND (NUMBERP Z)
		      (NOT (EQUAL (ADD1 Z) 0))
		      (LESSP (ADD1 Z) 1))
		 (EQUAL 0 Z)),

  which we further simplify, using linear arithmetic, to:

        T.

Q.E.D.


[ 0.237988282 0.156022135 ]

DIFFERENCE-1 


(DEFN PROG-TRANS-OF-SIGMA
      (I AC)
      (IF (ZEROP I)
	  AC
	  (PROG-TRANS-OF-SIGMA (DIFFERENCE I 1.)
			       (PLUS AC I))))
     Linear arithmetic, the lemmas COUNT-NUMBERP and DIFFERENCE-1,
and the definition of ZEROP can be used to prove that the measure
(COUNT I) decreases according to the well-founded relation LESSP in
each recursive call.  Hence, PROG-TRANS-OF-SIGMA is accepted under
the principle of definition.  Observe that:
      (OR (NUMBERP (PROG-TRANS-OF-SIGMA I AC))
	  (EQUAL (PROG-TRANS-OF-SIGMA I AC) AC))
is a theorem.




[ 0.3680013 0.0559895835 ]

PROG-TRANS-OF-SIGMA 


(PROVE-LEMMA FUNCTIONAL-LOOP-INVRT
	     (REWRITE)
	     (IMPLIES (NUMBERP AC)
		      (EQUAL (PROG-TRANS-OF-SIGMA I AC)
			     (PLUS AC (SIGMA 0. I)))))

     Call the conjecture *1.


     We will appeal to induction.  Three inductions are suggested by
terms in the conjecture, all of which are unflawed.  So we will
choose the one suggested by the largest number of nonprimitive
recursive functions.  We will induct according to the following
scheme:
      (AND (IMPLIES (ZEROP I) (P I AC))
	   (IMPLIES (AND (NOT (ZEROP I))
			 (P (DIFFERENCE I 1) (PLUS AC I)))
		    (P I AC))).
Linear arithmetic, the lemmas COUNT-NUMBERP and DIFFERENCE-1, and the
definition of ZEROP establish that the measure (COUNT I) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  Note, however, the inductive instance chosen for AC.
The above induction scheme generates two new goals:

Case 2. (IMPLIES (AND (ZEROP I) (NUMBERP AC))
		 (EQUAL (PROG-TRANS-OF-SIGMA I AC)
			(PLUS AC (SIGMA 0 I)))),

  which we simplify, rewriting with COMMUTATIVITY-OF-PLUS, and
  unfolding the definitions of ZEROP, EQUAL, PROG-TRANS-OF-SIGMA,
  SIGMA, PLUS, and LESSP, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP I))
		      (EQUAL (PROG-TRANS-OF-SIGMA (DIFFERENCE I 1)
						  (PLUS AC I))
			     (PLUS (PLUS AC I)
				   (SIGMA 0 (DIFFERENCE I 1))))
		      (NUMBERP AC))
		 (EQUAL (PROG-TRANS-OF-SIGMA I AC)
			(PLUS AC (SIGMA 0 I)))).

  This simplifies, applying DIFFERENCE-1, ASSOCIATIVITY-OF-PLUS, and
  CORRECTNESS-OF-CANCEL, and expanding the functions ZEROP,
  PROG-TRANS-OF-SIGMA, and FIX, to:

        (IMPLIES (AND (NOT (EQUAL I 0))
		      (NUMBERP I)
		      (EQUAL (PROG-TRANS-OF-SIGMA (DIFFERENCE I 1)
						  (PLUS AC I))
			     (PLUS AC
				   (PLUS I (SIGMA 0 (SUB1 I)))))
		      (NUMBERP AC))
		 (EQUAL (PLUS I (SIGMA 0 (SUB1 I)))
			(SIGMA 0 I))),

  which we again simplify, unfolding LESSP, EQUAL, and SIGMA, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.63302408 0.2589681 ]

FUNCTIONAL-LOOP-INVRT 


(PROVE-LEMMA CORRECTNESS-OF-FUNCTIONAL-SIGMA NIL
	     (EQUAL (PROG-TRANS-OF-SIGMA I 0.)
		    (SIGMA 0. I)))
This conjecture simplifies, applying FUNCTIONAL-LOOP-INVRT, and
unfolding the functions EQUAL and PLUS, to:

      T.

Q.E.D.


[ 0.177978516 0.0210123698 ]

CORRECTNESS-OF-FUNCTIONAL-SIGMA 


(PROVE-LEMMA SIGMA-INPUT-PATH NIL
	     (AND (EQUAL 0. (SIGMA K K))
		  (LEQ K K)))
This conjecture can be simplified, using the abbreviations NOT and
AND, to two new conjectures:

Case 2. (EQUAL 0 (SIGMA K K)).

  Call the above conjecture *1.

Case 1. ( LEQ K K).

  This simplifies, using linear arithmetic, to:

        T.


     So let us turn our attention to:

      (EQUAL 0 (SIGMA K K)),

which we named *1 above.  Perhaps we can prove it by induction.
There is only one plausible induction.  We will induct according to
the following scheme:
      (AND (IMPLIES (AND (LESSP K K) (P (SUB1 K)))
		    (P K))
	   (IMPLIES ( LEQ K K) (P K))).
Linear arithmetic and the lemmas COUNT-NUMBERP and COUNT-NOT-LESSP
inform us that the measure (COUNT K) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme produces two new formulas:

Case 2. (IMPLIES (AND (LESSP K K)
		      (EQUAL 0 (SIGMA (SUB1 K) (SUB1 K))))
		 (EQUAL 0 (SIGMA K K))).

  This simplifies, using linear arithmetic, to:

        T.

Case 1. (IMPLIES ( LEQ K K)
		 (EQUAL 0 (SIGMA K K))).

  This simplifies, expanding the definitions of SIGMA and EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.332014974 0.179003906 ]

SIGMA-INPUT-PATH 


(PROVE-LEMMA SIGMA-LOOP-INVRT NIL
	     (IMPLIES (AND (NOT (ZEROP I)) (LEQ I K))
		      (AND (EQUAL (PLUS (SIGMA I K) I)
				  (SIGMA (SUB1 I) K))
			   (LEQ (SUB1 I) K))))
This formula can be simplified, using the abbreviations ZEROP, NOT,
AND, and IMPLIES, to:

      (IMPLIES (AND (NOT (EQUAL I 0))
		    (NUMBERP I)
		    ( LEQ I K))
	       (AND (EQUAL (PLUS (SIGMA I K) I)
			   (SIGMA (SUB1 I) K))
		    (IF (LESSP K (SUB1 I)) F T))).

This simplifies, rewriting with COMMUTATIVITY-OF-PLUS, and opening up
the definitions of PLUS and AND, to two new conjectures:

Case 2. (IMPLIES (AND (NOT (EQUAL I 0))
		      (NUMBERP I)
		      ( LEQ I K))
		 (EQUAL (ADD1 (PLUS (SUB1 I) (SIGMA I K)))
			(SIGMA (SUB1 I) K))).

  Applying the lemma SUB1-ELIM, replace I by (ADD1 X) to eliminate
  (SUB1 I).  We use the type restriction lemma noted when SUB1 was
  introduced to constrain the new variable.  We must thus prove:

        (IMPLIES (AND (NUMBERP X)
		      (NOT (EQUAL (ADD1 X) 0))
		      ( LEQ (ADD1 X) K))
		 (EQUAL (ADD1 (PLUS X (SIGMA (ADD1 X) K)))
			(SIGMA X K))),

  which further simplifies, applying SUB1-ADD1, and expanding the
  definition of LESSP, to the formula:

        (IMPLIES (AND (NUMBERP X)
		      (NOT (EQUAL K 0))
		      (NUMBERP K)
		      ( LEQ X (SUB1 K)))
		 (EQUAL (ADD1 (PLUS X (SIGMA (ADD1 X) K)))
			(SIGMA X K))).

  Applying the lemma SUB1-ELIM, replace K by (ADD1 Z) to eliminate
  (SUB1 K).  We employ the type restriction lemma noted when SUB1 was
  introduced to restrict the new variable.  This generates the new
  conjecture:

        (IMPLIES (AND (NUMBERP Z)
		      (NUMBERP X)
		      (NOT (EQUAL (ADD1 Z) 0))
		      ( LEQ X Z))
		 (EQUAL (ADD1 (PLUS X (SIGMA (ADD1 X) (ADD1 Z))))
			(SIGMA X (ADD1 Z)))),

  which we further simplify, rewriting with SUB1-ADD1, and opening up
  PLUS, LESSP, and SIGMA, to six new conjectures:

  Case 2.6.
          (IMPLIES (AND (NUMBERP Z)
			(NUMBERP X)
			( LEQ X Z)
			(LESSP (SUB1 X) Z)
			( LEQ Z X))
		   (EQUAL (ADD1 (PLUS X 0))
			  (ADD1 (PLUS Z (SIGMA X Z))))),

    which we again simplify, using linear arithmetic, to the new
    formula:

          (IMPLIES (AND (NUMBERP X)
			(NUMBERP X)
			( LEQ X X)
			(LESSP (SUB1 X) X)
			( LEQ X X))
		   (EQUAL (ADD1 (PLUS X 0))
			  (ADD1 (PLUS X (SIGMA X X))))).

    This finally simplifies, rewriting with COMMUTATIVITY-OF-PLUS,
    and expanding the definitions of EQUAL, PLUS, and SIGMA, to:

          T.

  Case 2.5.
          (IMPLIES (AND (NUMBERP Z)
			(NUMBERP X)
			( LEQ X Z)
			(EQUAL X 0)
			( LEQ Z X))
		   (EQUAL (ADD1 (PLUS X 0))
			  (ADD1 (PLUS Z (SIGMA X Z))))).

    However this finally simplifies, opening up NUMBERP, EQUAL, LESSP,
    PLUS, ADD1, and SIGMA, to:

          T.

  Case 2.4.
          (IMPLIES
	       (AND (NUMBERP Z)
		    (NUMBERP X)
		    ( LEQ X Z)
		    (LESSP (SUB1 X) Z)
		    (LESSP X Z))
	       (EQUAL (ADD1 (PLUS X
				  (ADD1 (PLUS Z (SIGMA (ADD1 X) Z)))))
		      (ADD1 (PLUS Z (SIGMA X Z))))).

    This simplifies again, applying PLUS-ADD1 and ADD1-EQUAL, to:

          (IMPLIES (AND (NUMBERP Z)
			(NUMBERP X)
			( LEQ X Z)
			(LESSP (SUB1 X) Z)
			(LESSP X Z))
		   (EQUAL (ADD1 (PLUS X (PLUS Z (SIGMA (ADD1 X) Z))))
			  (PLUS Z (SIGMA X Z)))),

    which we would normally push and work on later by induction.  But
    if we must use induction to prove the input conjecture, we prefer
    to induct on the original formulation of the problem.  Thus we
    will disregard all that we have previously done, give the name *1
    to the original input, and work on it.


     So now let us consider:

(AND (IMPLIES (AND (NOT (ZEROP I))
		   (IF (LESSP K I) F T))
	      (EQUAL (PLUS (SIGMA I K) I)
		     (SIGMA (SUB1 I) K)))
     (IMPLIES (AND (NOT (ZEROP I))
		   (IF (LESSP K I) F T))
	      (IF (LESSP K (SUB1 I)) F T))),

which we named *1 above.  Let us appeal to the induction principle.
There are seven plausible inductions.  They merge into two likely
candidate inductions.  However, only one is unflawed.  We will induct
according to the following scheme:
      (AND (IMPLIES (AND (LESSP I K) (P (SUB1 K) I))
		    (P K I))
	   (IMPLIES ( LEQ K I) (P K I))).
Linear arithmetic and the lemmas COUNT-NUMBERP and COUNT-NOT-LESSP
can be used to show that the measure (COUNT K) decreases according to
the well-founded relation LESSP in each induction step of the scheme.
The above induction scheme generates the following six new
conjectures:

Case 6. (IMPLIES (AND (LESSP I K)
		      (NOT (IF (LESSP (SUB1 K) I) F T))
		      (NOT (ZEROP I))
		      (IF (LESSP K I) F T))
		 (EQUAL (PLUS (SIGMA I K) I)
			(SIGMA (SUB1 I) K))).

  This simplifies, rewriting with COMMUTATIVITY-OF-PLUS,
  COMMUTATIVITY2-OF-PLUS, and ASSOCIATIVITY-OF-PLUS, and expanding
  the functions LESSP, EQUAL, ZEROP, and SIGMA, to the following two
  new conjectures:

  Case 6.2.
          (IMPLIES (AND (NOT (EQUAL K 0))
			(NUMBERP K)
			(LESSP (SUB1 I) (SUB1 K))
			(LESSP (SUB1 K) I)
			(NOT (EQUAL I 0))
			(NUMBERP I)
			( LEQ (SUB1 I) (SUB1 K))
			( LEQ K (SUB1 I)))
		   (EQUAL (PLUS I (PLUS K (SIGMA I (SUB1 K))))
			  0)),

    which we again simplify, using linear arithmetic, to:

          T.

  Case 6.1.
          (IMPLIES (AND (NOT (EQUAL K 0))
			(NUMBERP K)
			(LESSP (SUB1 I) (SUB1 K))
			(LESSP (SUB1 K) I)
			(NOT (EQUAL I 0))
			(NUMBERP I)
			( LEQ (SUB1 I) (SUB1 K))
			(LESSP (SUB1 I) K))
		   (EQUAL (PLUS I (PLUS K (SIGMA I (SUB1 K))))
			  (PLUS K (SIGMA (SUB1 I) (SUB1 K))))),

    which we again simplify, using linear arithmetic, to:

          T.

Case 5. (IMPLIES (AND (LESSP I K)
		      (EQUAL (PLUS (SIGMA I (SUB1 K)) I)
			     (SIGMA (SUB1 I) (SUB1 K)))
		      (IF (LESSP (SUB1 K) (SUB1 I)) F T)
		      (NOT (ZEROP I))
		      (IF (LESSP K I) F T))
		 (EQUAL (PLUS (SIGMA I K) I)
			(SIGMA (SUB1 I) K))),

  which we simplify, applying the lemmas COMMUTATIVITY-OF-PLUS,
  SUB1-NNUMBERP, and PLUS-ADD1, and opening up the definitions of
  LESSP, EQUAL, PLUS, SUB1, ZEROP, and SIGMA, to two new formulas:

  Case 5.2.
          (IMPLIES
	       (AND (NOT (EQUAL K 0))
		    (NUMBERP K)
		    (LESSP (SUB1 I) (SUB1 K))
		    (NOT (EQUAL I 0))
		    (NUMBERP I)
		    (EQUAL (ADD1 (PLUS (SUB1 I) (SIGMA I (SUB1 K))))
			   (SIGMA (SUB1 I) (SUB1 K)))
		    ( LEQ (SUB1 I) (SUB1 K))
		    ( LEQ K (SUB1 I)))
	       (EQUAL (ADD1 (PLUS I
				  (PLUS (SUB1 K) (SIGMA I (SUB1 K)))))
		      0)),

    which again simplifies, using linear arithmetic, to:

          T.

  Case 5.1.
          (IMPLIES
	       (AND (NOT (EQUAL K 0))
		    (NUMBERP K)
		    (LESSP (SUB1 I) (SUB1 K))
		    (NOT (EQUAL I 0))
		    (NUMBERP I)
		    (EQUAL (ADD1 (PLUS (SUB1 I) (SIGMA I (SUB1 K))))
			   (SIGMA (SUB1 I) (SUB1 K)))
		    ( LEQ (SUB1 I) (SUB1 K))
		    (LESSP (SUB1 I) K))
	       (EQUAL (ADD1 (PLUS I
				  (PLUS (SUB1 K) (SIGMA I (SUB1 K)))))
		      (ADD1 (PLUS (SUB1 K)
				  (SIGMA (SUB1 I) (SUB1 K)))))),

    which again simplifies, using linear arithmetic, to:

          T.

Case 4. (IMPLIES (AND ( LEQ K I)
		      (NOT (ZEROP I))
		      (IF (LESSP K I) F T))
		 (EQUAL (PLUS (SIGMA I K) I)
			(SIGMA (SUB1 I) K))).

  This simplifies, expanding the functions ZEROP, SIGMA, EQUAL, and
  PLUS, to:

        (IMPLIES (AND ( LEQ K I)
		      (NOT (EQUAL I 0))
		      (NUMBERP I)
		      ( LEQ I K))
		 (EQUAL I (SIGMA (SUB1 I) K))).

  This again simplifies, using linear arithmetic, to the following
  two new conjectures:

  Case 4.2.
          (IMPLIES (AND (NOT (NUMBERP K))
			( LEQ K I)
			(NOT (EQUAL I 0))
			(NUMBERP I)
			( LEQ I K))
		   (EQUAL I (SIGMA (SUB1 I) K))),

    which again simplifies, expanding the function LESSP, to:

          T.

  Case 4.1.
          (IMPLIES (AND (NUMBERP K)
			( LEQ I I)
			(NOT (EQUAL I 0))
			(NUMBERP I)
			( LEQ I I))
		   (EQUAL I (SIGMA (SUB1 I) I))),

    which we again simplify, applying the lemma COMMUTATIVITY-OF-PLUS,
    and expanding the functions LESSP, SIGMA, EQUAL, and PLUS, to the
    formula:

          (IMPLIES (AND (NUMBERP K)
			( LEQ (SUB1 I) (SUB1 I))
			(NOT (EQUAL I 0))
			(NUMBERP I))
		   (LESSP (SUB1 I) I)).

    This simplifies again, using linear arithmetic, to:

          T.

Case 3. (IMPLIES (AND (LESSP I K)
		      (NOT (IF (LESSP (SUB1 K) I) F T))
		      (NOT (ZEROP I))
		      (IF (LESSP K I) F T))
		 (IF (LESSP K (SUB1 I)) F T)).

  This simplifies, opening up the functions LESSP, EQUAL, and ZEROP,
  to:

        (IMPLIES (AND (NOT (EQUAL K 0))
		      (NUMBERP K)
		      (LESSP (SUB1 I) (SUB1 K))
		      (LESSP (SUB1 K) I)
		      (NOT (EQUAL I 0))
		      (NUMBERP I)
		      ( LEQ (SUB1 I) (SUB1 K)))
		 ( LEQ (SUB1 I) K)),

  which again simplifies, using linear arithmetic, to:

        T.

Case 2. (IMPLIES (AND (LESSP I K)
		      (EQUAL (PLUS (SIGMA I (SUB1 K)) I)
			     (SIGMA (SUB1 I) (SUB1 K)))
		      (IF (LESSP (SUB1 K) (SUB1 I)) F T)
		      (NOT (ZEROP I))
		      (IF (LESSP K I) F T))
		 (IF (LESSP K (SUB1 I)) F T)).

  This simplifies, applying COMMUTATIVITY-OF-PLUS and SUB1-NNUMBERP,
  and opening up LESSP, EQUAL, PLUS, SUB1, and ZEROP, to:

        (IMPLIES (AND (NOT (EQUAL K 0))
		      (NUMBERP K)
		      (LESSP (SUB1 I) (SUB1 K))
		      (NOT (EQUAL I 0))
		      (NUMBERP I)
		      (EQUAL (ADD1 (PLUS (SUB1 I) (SIGMA I (SUB1 K))))
			     (SIGMA (SUB1 I) (SUB1 K)))
		      ( LEQ (SUB1 I) (SUB1 K)))
		 ( LEQ (SUB1 I) K)).

  But this again simplifies, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (AND ( LEQ K I)
		      (NOT (ZEROP I))
		      (IF (LESSP K I) F T))
		 (IF (LESSP K (SUB1 I)) F T)),

  which simplifies, unfolding the function ZEROP, to the formula:

        (IMPLIES (AND ( LEQ K I)
		      (NOT (EQUAL I 0))
		      (NUMBERP I)
		      ( LEQ I K))
		 ( LEQ (SUB1 I) K)).

  This simplifies again, using linear arithmetic, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 12.1959635 2.07104492 ]

SIGMA-LOOP-INVRT 


(PROVE-LEMMA SIGMA-OUTPUT-PATH NIL
	     (IMPLIES (AND (ZEROP I) (LEQ I K))
		      (EQUAL (SIGMA I K) (SIGMA 0. K))))
This conjecture simplifies, expanding ZEROP, EQUAL, and LESSP, to the
new conjecture:

      (IMPLIES (NOT (NUMBERP I))
	       (EQUAL (SIGMA I K) (SIGMA 0 K))).

Call the above conjecture *1.


     Let us appeal to the induction principle.  There are two
plausible inductions.  However, they merge into one likely candidate
induction.  We will induct according to the following scheme:
      (AND (IMPLIES (AND (LESSP I K) (P I (SUB1 K)))
		    (P I K))
	   (IMPLIES ( LEQ K I) (P I K))).
Linear arithmetic and the lemmas COUNT-NUMBERP and COUNT-NOT-LESSP
establish that the measure (COUNT K) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme generates two new goals:

Case 2. (IMPLIES (AND (LESSP I K)
		      (EQUAL (SIGMA I (SUB1 K))
			     (SIGMA 0 (SUB1 K)))
		      (NOT (NUMBERP I)))
		 (EQUAL (SIGMA I K) (SIGMA 0 K))).

  This simplifies, opening up LESSP, SIGMA, PLUS, and EQUAL, to:

        T.

Case 1. (IMPLIES (AND ( LEQ K I) (NOT (NUMBERP I)))
		 (EQUAL (SIGMA I K) (SIGMA 0 K))),

  which simplifies, opening up the functions LESSP, EQUAL, and SIGMA,
  to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.937972 0.175016277 ]

SIGMA-OUTPUT-PATH 


(DEFN SET
      (ADDR VAL MEM)
      (IF (ZEROP ADDR)
	  (CONS VAL (CDR MEM))
	  (CONS (CAR MEM)
		(SET (SUB1 ADDR) VAL (CDR MEM)))))
     Linear arithmetic, the lemma COUNT-NUMBERP, and the definition
of ZEROP establish that the measure (COUNT ADDR) decreases according
to the well-founded relation LESSP in each recursive call.  Hence,
SET is accepted under the principle of definition.  Note that:
      (LISTP (SET ADDR VAL MEM))
is a theorem.




[ 0.229003906 0.0450032554 ]

SET 


(DEFN GET
      (ADDR MEM)
      (IF (ZEROP ADDR)
	  (CAR MEM)
	  (GET (SUB1 ADDR) (CDR MEM))))
     Linear arithmetic, the lemma COUNT-NUMBERP, and the definition
of ZEROP can be used to prove that the measure (COUNT ADDR) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, GET is accepted under the principle of definition.




[ 0.20999349 0.0369954426 ]

GET 


(PROVE-LEMMA GET-SET
	     (REWRITE)
	     (EQUAL (GET J (SET I VAL MEM))
		    (IF (EQP J I) VAL (GET J MEM))))
This conjecture simplifies, expanding EQP, to the following seven new
goals:

Case 7. (IMPLIES (AND (NUMBERP J)
		      (NOT (NUMBERP I))
		      (NOT (EQUAL J 0)))
		 (EQUAL (GET J (SET I VAL MEM))
			(GET J MEM))),

  which again simplifies, unfolding the definition of SET, to the new
  conjecture:

        (IMPLIES (AND (NUMBERP J)
		      (NOT (NUMBERP I))
		      (NOT (EQUAL J 0)))
		 (EQUAL (GET J (CONS VAL (CDR MEM)))
			(GET J MEM))).

  Applying the lemma CAR-CDR-ELIM, we now replace MEM by (CONS Z X)
  to eliminate (CDR MEM) and (CAR MEM).  We must thus prove two new
  goals:

  Case 7.2.
          (IMPLIES (AND (NOT (LISTP MEM))
			(NUMBERP J)
			(NOT (NUMBERP I))
			(NOT (EQUAL J 0)))
		   (EQUAL (GET J (CONS VAL (CDR MEM)))
			  (GET J MEM))).

    However this further simplifies, appealing to the lemma
    CDR-NLISTP, to:

          (IMPLIES (AND (NOT (LISTP MEM))
			(NUMBERP J)
			(NOT (NUMBERP I))
			(NOT (EQUAL J 0)))
		   (EQUAL (GET J (CONS VAL 0))
			  (GET J MEM))),

    which we would usually push and work on later by induction.  But
    if we must use induction to prove the input conjecture, we prefer
    to induct on the original formulation of the problem.  Thus we
    will disregard all that we have previously done, give the name *1
    to the original input, and work on it.


     So now let us consider:

(EQUAL (GET J (SET I VAL MEM))
       (IF (EQP J I) VAL (GET J MEM))),

named *1 above.  Let us appeal to the induction principle.  The
recursive terms in the conjecture suggest three inductions.  However,
they merge into one likely candidate induction.  We will induct
according to the following scheme:
      (AND (IMPLIES (ZEROP J) (P J I VAL MEM))
	   (IMPLIES (AND (NOT (ZEROP J))
			 (P (SUB1 J) (SUB1 I) VAL (CDR MEM)))
		    (P J I VAL MEM))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP establish that the measure (COUNT J) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
Note, however, the inductive instances chosen for I and MEM.  The
above induction scheme generates two new conjectures:

Case 2. (IMPLIES (ZEROP J)
		 (EQUAL (GET J (SET I VAL MEM))
			(IF (EQP J I) VAL (GET J MEM)))),

  which we simplify, unfolding ZEROP, SET, EQUAL, GET, NUMBERP, and
  EQP, to ten new conjectures:

  Case 2.10.
          (IMPLIES (AND (EQUAL J 0)
			(NUMBERP I)
			(NOT (EQUAL 0 I))
			(NOT (EQUAL I 0)))
		   (EQUAL (CAR (CONS (CAR MEM)
				     (SET (SUB1 I) VAL (CDR MEM))))
			  (CAR MEM))),

    which we again simplify, applying CAR-CONS, to:

          T.

  Case 2.9.
          (IMPLIES (AND (EQUAL J 0)
			(NUMBERP I)
			(NOT (EQUAL 0 I))
			(EQUAL I 0))
		   (EQUAL (CAR (CONS VAL (CDR MEM)))
			  (CAR MEM))).

    This again simplifies, trivially, to:

          T.

  Case 2.8.
          (IMPLIES (AND (EQUAL J 0)
			(NUMBERP I)
			(EQUAL 0 I)
			(NOT (EQUAL I 0)))
		   (EQUAL (CAR (CONS (CAR MEM)
				     (SET (SUB1 I) VAL (CDR MEM))))
			  VAL)),

    which again simplifies, clearly, to:

          T.

  Case 2.7.
          (IMPLIES (AND (EQUAL J 0)
			(EQUAL 0 I)
			(EQUAL I 0))
		   (EQUAL (CAR (CONS VAL (CDR MEM)))
			  VAL)),

    which again simplifies, rewriting with CAR-CONS, and unfolding
    the function EQUAL, to:

          T.

  Case 2.6.
          (IMPLIES (AND (EQUAL J 0) (NOT (NUMBERP I)))
		   (EQUAL (CAR (CONS VAL (CDR MEM)))
			  VAL)).

    This simplifies again, rewriting with the lemma CAR-CONS, to:

          T.

  Case 2.5.
          (IMPLIES (AND (NOT (NUMBERP J))
			(NUMBERP I)
			(NOT (EQUAL 0 I))
			(NOT (EQUAL I 0)))
		   (EQUAL (CAR (CONS (CAR MEM)
				     (SET (SUB1 I) VAL (CDR MEM))))
			  (CAR MEM))).

    This again simplifies, applying CAR-CONS, to:

          T.

  Case 2.4.
          (IMPLIES (AND (NOT (NUMBERP J))
			(NUMBERP I)
			(NOT (EQUAL 0 I))
			(EQUAL I 0))
		   (EQUAL (CAR (CONS VAL (CDR MEM)))
			  (CAR MEM))).

    This again simplifies, clearly, to:

          T.

  Case 2.3.
          (IMPLIES (AND (NOT (NUMBERP J))
			(NUMBERP I)
			(EQUAL 0 I)
			(NOT (EQUAL I 0)))
		   (EQUAL (CAR (CONS (CAR MEM)
				     (SET (SUB1 I) VAL (CDR MEM))))
			  VAL)),

    which again simplifies, clearly, to:

          T.

  Case 2.2.
          (IMPLIES (AND (NOT (NUMBERP J))
			(EQUAL 0 I)
			(EQUAL I 0))
		   (EQUAL (CAR (CONS VAL (CDR MEM)))
			  VAL)),

    which we again simplify, applying CAR-CONS, and opening up the
    definition of EQUAL, to:

          T.

  Case 2.1.
          (IMPLIES (AND (NOT (NUMBERP J))
			(NOT (NUMBERP I)))
		   (EQUAL (CAR (CONS VAL (CDR MEM)))
			  VAL)),

    which we again simplify, applying CAR-CONS, to:

          T.

Case 1. (IMPLIES (AND (NOT (ZEROP J))
		      (EQUAL (GET (SUB1 J)
				  (SET (SUB1 I) VAL (CDR MEM)))
			     (IF (EQP (SUB1 J) (SUB1 I))
				 VAL
				 (GET (SUB1 J) (CDR MEM)))))
		 (EQUAL (GET J (SET I VAL MEM))
			(IF (EQP J I) VAL (GET J MEM)))),

  which we simplify, expanding ZEROP, EQP, SET, and GET, to ten new
  goals:

  Case 1.10.
          (IMPLIES (AND (NOT (EQUAL J 0))
			(NUMBERP J)
			(NOT (EQUAL (SUB1 J) (SUB1 I)))
			(EQUAL (GET (SUB1 J)
				    (SET (SUB1 I) VAL (CDR MEM)))
			       (GET (SUB1 J) (CDR MEM)))
			(NUMBERP I)
			(NOT (EQUAL J I))
			(NOT (EQUAL I 0)))
		   (EQUAL (GET J
			       (CONS (CAR MEM)
				     (SET (SUB1 I) VAL (CDR MEM))))
			  (GET (SUB1 J) (CDR MEM)))),

    which again simplifies, applying CDR-CONS, and opening up the
    definition of GET, to:

          T.

  Case 1.9.
          (IMPLIES (AND (NOT (EQUAL J 0))
			(NUMBERP J)
			(NOT (EQUAL (SUB1 J) (SUB1 I)))
			(EQUAL (GET (SUB1 J)
				    (SET (SUB1 I) VAL (CDR MEM)))
			       (GET (SUB1 J) (CDR MEM)))
			(NOT (EQUAL J I))
			(EQUAL I 0))
		   (EQUAL (GET J (CONS VAL (CDR MEM)))
			  (GET (SUB1 J) (CDR MEM)))),

    which we again simplify, applying CDR-CONS, and expanding SUB1,
    EQUAL, SET, and GET, to:

          T.

  Case 1.8.
          (IMPLIES (AND (NOT (EQUAL J 0))
			(NUMBERP J)
			(NOT (EQUAL (SUB1 J) (SUB1 I)))
			(EQUAL (GET (SUB1 J)
				    (SET (SUB1 I) VAL (CDR MEM)))
			       (GET (SUB1 J) (CDR MEM)))
			(NOT (NUMBERP I)))
		   (EQUAL (GET J (CONS VAL (CDR MEM)))
			  (GET (SUB1 J) (CDR MEM)))).

    This simplifies again, rewriting with SUB1-NNUMBERP and CDR-CONS,
    and expanding the function GET, to:

          T.

  Case 1.7.
          (IMPLIES (AND (NOT (EQUAL J 0))
			(NUMBERP J)
			(NOT (EQUAL (SUB1 J) (SUB1 I)))
			(EQUAL (GET (SUB1 J)
				    (SET (SUB1 I) VAL (CDR MEM)))
			       (GET (SUB1 J) (CDR MEM)))
			(NUMBERP I)
			(EQUAL J I)
			(NOT (EQUAL I 0)))
		   (EQUAL (GET J
			       (CONS (CAR MEM)
				     (SET (SUB1 I) VAL (CDR MEM))))
			  VAL)),

    which we again simplify, trivially, to:

          T.

  Case 1.6.
          (IMPLIES (AND (NOT (EQUAL J 0))
			(NUMBERP J)
			(NOT (EQUAL (SUB1 J) (SUB1 I)))
			(EQUAL (GET (SUB1 J)
				    (SET (SUB1 I) VAL (CDR MEM)))
			       (GET (SUB1 J) (CDR MEM)))
			(NUMBERP I)
			(EQUAL J I)
			(EQUAL I 0))
		   (EQUAL (GET J (CONS VAL (CDR MEM)))
			  VAL)),

    which again simplifies, trivially, to:

          T.

  Case 1.5.
          (IMPLIES (AND (NOT (EQUAL J 0))
			(NUMBERP J)
			(EQUAL (SUB1 J) (SUB1 I))
			(EQUAL (GET (SUB1 J)
				    (SET (SUB1 I) VAL (CDR MEM)))
			       VAL)
			(NUMBERP I)
			(NOT (EQUAL J I))
			(NOT (EQUAL I 0)))
		   (EQUAL (GET J
			       (CONS (CAR MEM)
				     (SET (SUB1 I) VAL (CDR MEM))))
			  (GET (SUB1 J) (CDR MEM)))),

    which again simplifies, using linear arithmetic, to:

          T.

  Case 1.4.
          (IMPLIES (AND (NOT (EQUAL J 0))
			(NUMBERP J)
			(EQUAL (SUB1 J) (SUB1 I))
			(EQUAL (GET (SUB1 J)
				    (SET (SUB1 I) VAL (CDR MEM)))
			       VAL)
			(NOT (EQUAL J I))
			(EQUAL I 0))
		   (EQUAL (GET J (CONS VAL (CDR MEM)))
			  (GET (SUB1 J) (CDR MEM)))),

    which again simplifies, applying CAR-CONS and CDR-CONS, and
    unfolding SUB1, EQUAL, SET, and GET, to:

          (IMPLIES (AND (NUMBERP J)
			(EQUAL (SUB1 J) 0)
			(NOT (EQUAL J 0)))
		   (EQUAL (CADR MEM)
			  (GET (SUB1 J) (CDR MEM)))),

    which again simplifies, unfolding the definitions of EQUAL and
    GET, to:

          T.

  Case 1.3.
          (IMPLIES (AND (NOT (EQUAL J 0))
			(NUMBERP J)
			(EQUAL (SUB1 J) (SUB1 I))
			(EQUAL (GET (SUB1 J)
				    (SET (SUB1 I) VAL (CDR MEM)))
			       VAL)
			(NOT (NUMBERP I)))
		   (EQUAL (GET J (CONS VAL (CDR MEM)))
			  (GET (SUB1 J) (CDR MEM)))).

    However this simplifies again, applying SUB1-NNUMBERP and
    CDR-CONS, and opening up GET and EQUAL, to:

          (IMPLIES (AND (NOT (EQUAL J 0))
			(NUMBERP J)
			(EQUAL (SUB1 J) 0)
			(EQUAL (GET (SUB1 J)
				    (SET (SUB1 I) VAL (CDR MEM)))
			       VAL)
			(NOT (NUMBERP I)))
		   (EQUAL (CADR MEM)
			  (GET (SUB1 J) (CDR MEM)))).

    But this again simplifies, unfolding the definitions of EQUAL and
    GET, to:

          T.

  Case 1.2.
          (IMPLIES (AND (NOT (EQUAL J 0))
			(NUMBERP J)
			(EQUAL (SUB1 J) (SUB1 I))
			(EQUAL (GET (SUB1 J)
				    (SET (SUB1 I) VAL (CDR MEM)))
			       VAL)
			(NUMBERP I)
			(EQUAL J I)
			(NOT (EQUAL I 0)))
		   (EQUAL (GET J
			       (CONS (CAR MEM)
				     (SET (SUB1 I) VAL (CDR MEM))))
			  VAL)),

    which again simplifies, applying the lemma CDR-CONS, and
    unfolding the definition of GET, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NOT (EQUAL J 0))
			(NUMBERP J)
			(EQUAL (SUB1 J) (SUB1 I))
			(EQUAL (GET (SUB1 J)
				    (SET (SUB1 I) VAL (CDR MEM)))
			       VAL)
			(NUMBERP I)
			(EQUAL J I)
			(EQUAL I 0))
		   (EQUAL (GET J (CONS VAL (CDR MEM)))
			  VAL)).

    This simplifies again, obviously, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 4.5359212 1.14008789 ]

GET-SET 


(DEFN EXECUTE1
 (PC MEM MAX)
 (IF
  ( LEQ MAX PC)
  (LIST F MEM)
  (IF
   (EQUAL (GET PC MEM) '(STOP))
   (LIST F MEM)
   (IF
    (EQUAL (CAR (GET PC MEM)) 'JUMPA)
    (LIST (CADR (GET PC MEM)) MEM)
    (IF
       (EQUAL (CAR (GET PC MEM)) 'SKIPNE)
       (IF (ZEROP (GET (CADR (GET PC MEM)) MEM))
	   (EXECUTE1 (ADD1 PC) MEM MAX)
	   (EXECUTE1 (ADD1 (ADD1 PC)) MEM MAX))
       (IF (EQUAL (CAR (GET PC MEM)) 'SUBI)
	   (EXECUTE1 (ADD1 PC)
		     (SET (CADR (GET PC MEM))
			  (DIFFERENCE (GET (CADR (GET PC MEM)) MEM)
				      (CADDR (GET PC MEM)))
			  MEM)
		     MAX)
	   (IF (EQUAL (CAR (GET PC MEM)) 'ADDI)
	       (EXECUTE1 (ADD1 PC)
			 (SET (CADR (GET PC MEM))
			      (PLUS (CADDR (GET PC MEM))
				    (GET (CADR (GET PC MEM)) MEM))
			      MEM)
			 MAX)
	       (IF (EQUAL (CAR (GET PC MEM)) 'ADD)
		   (EXECUTE1 (ADD1 PC)
			     (SET (CADR (GET PC MEM))
				  (PLUS (GET (CADDR (GET PC MEM)) MEM)
					(GET (CADR (GET PC MEM)) MEM))
				  MEM)
			     MAX)
		   (IF (EQUAL (CAR (GET PC MEM)) 'MOVEI)
		       (EXECUTE1 (ADD1 PC)
				 (SET (CADR (GET PC MEM))
				      (CADDR (GET PC MEM))
				      MEM)
				 MAX)
		       (LIST F MEM)))))))))
 ((LESSP (DIFFERENCE MAX PC))))
     Linear arithmetic, the lemmas SUB1-TYPE-RESTRICTION,
PLUS-RIGHT-ID2, DIFFERENCE-PLUS2, DIFFERENCE-0,
LESSP-PLUS-CANCELLATION3, PLUS-EQUAL-0, and SUB1-ADD1, and the
definitions of LESSP, DIFFERENCE, ADD1, GET, ZEROP, EQUAL, and
NUMBERP can be used to prove that the measure (DIFFERENCE MAX PC)
decreases according to the well-founded relation LESSP in each
recursive call.  Hence, EXECUTE1 is accepted under the principle of
definition.  Observe that (LISTP (EXECUTE1 PC MEM MAX)) is a theorem.




[ 3.49500325 0.140999349 ]

EXECUTE1 


(DEFN EXECUTE
      (PC MEM CLK)
      (IF (ZEROP CLK)
	  MEM
	  (IF (NUMBERP PC)
	      (EXECUTE (CAR (EXECUTE1 PC MEM (LENGTH MEM)))
		       (CADR (EXECUTE1 PC MEM (LENGTH MEM)))
		       (SUB1 CLK))
	      MEM)))
     Linear arithmetic, the lemma COUNT-NUMBERP, and the definition
of ZEROP establish that the measure (COUNT CLK) decreases according
to the well-founded relation LESSP in each recursive call.  Hence,
EXECUTE is accepted under the definitional principle.




[ 1.77399088 0.0360026043 ]

EXECUTE 


(DEFN GET-SIMPLIFIER
      (X)
      (IF (AND (LISTP X)
	       (EQUAL (CAR X) 'GET)
	       (LISTP (CADR X))
	       (EQUAL (CAR (CADR X)) 'QUOTE))
	  (IF (ZEROP (CADR (CADR X)))
	      (LIST 'CAR (CADDR X))
	      (LIST 'GET
		    (LIST 'QUOTE (SUB1 (CADR (CADR X))))
		    (LIST 'CDR (CADDR X))))
	  X))
     Note that:
      (OR (LISTP (GET-SIMPLIFIER X))
	  (EQUAL (GET-SIMPLIFIER X) X))
is a theorem.




[ 0.272998046 0.0150065104 ]

GET-SIMPLIFIER 


(PROVE-LEMMA CORRECTNESS-OF-GET-SIMPLIFIER
	     ((META GET))
	     (IMPLIES (FORMP X)
		      (AND (EQUAL (MEANING X A)
				  (MEANING (GET-SIMPLIFIER X) A))
			   (FORMP (GET-SIMPLIFIER X)))))

WARNING:  META lemmas must be proved in a constructive history.  The
current history contains the nonconstructive axiom NUMBERP-CALL.  If
this metalemma is proved using unsound axioms you may get wiped out
by the application of the metafunction.

This formula simplifies, opening up the definitions of GET-SIMPLIFIER
and AND, to the following six new formulas:

Case 6. (IMPLIES
		(AND (FORMP X)
		     (LISTP X)
		     (EQUAL (CAR X) 'GET)
		     (LISTP (CADR X))
		     (EQUAL (CAADR X) 'QUOTE)
		     (NOT (EQUAL (CADADR X) 0))
		     (NUMBERP (CADADR X)))
		(EQUAL (MEANING X A)
		       (MEANING (LIST 'GET
				      (LIST 'QUOTE (SUB1 (CADADR X)))
				      (LIST 'CDR (CADDR X)))
				A))).

  But this simplifies again, applying CAR-CONS and CDR-CONS, and
  expanding MEANING, to the new conjecture:

        (IMPLIES (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'GET)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'QUOTE)
		      (NOT (EQUAL (CADADR X) 0))
		      (NUMBERP (CADADR X)))
		 (EQUAL (MEANING X A)
			(GET (SUB1 (CADADR X))
			     (CDR (MEANING (CADDR X) A))))).

  Appealing to the lemmas SUB1-ELIM and CAR-CDR-ELIM, replace X by
  (CONS Z V) to eliminate (CAR X) and (CDR X), V by (CONS W D) to
  eliminate (CAR V) and (CDR V), W by (CONS V C) to eliminate (CAR W)
  and (CDR W), C by (CONS W X1) to eliminate (CAR C) and (CDR C), W
  by (ADD1 C) to eliminate (SUB1 W), D by (CONS W Z1) to eliminate
  (CAR D) and (CDR D), and D by (CONS W X1) to eliminate (CAR D) and
  (CDR D).  We rely upon the type restriction lemma noted when SUB1
  was introduced to restrict the new variables.  We would thus like
  to prove five new conjectures:

  Case 6.5.
          (IMPLIES (AND (NOT (LISTP V))
			(FORMP (CONS Z V))
			(EQUAL Z 'GET)
			(LISTP (CAR V))
			(EQUAL (CAAR V) 'QUOTE)
			(NOT (EQUAL (CADAR V) 0))
			(NUMBERP (CADAR V)))
		   (EQUAL (MEANING (CONS Z V) A)
			  (GET (SUB1 (CADAR V))
			       (CDR (MEANING (CADR V) A))))),

    which further simplifies, unfolding the functions FORMP, LENGTH,
    and EQUAL, to:

          T.

  Case 6.4.
          (IMPLIES (AND (NOT (LISTP D))
			(NOT (LISTP C))
			(FORMP (CONS Z (CONS (CONS V C) D)))
			(EQUAL Z 'GET)
			(EQUAL V 'QUOTE)
			(NOT (EQUAL (CAR C) 0))
			(NUMBERP (CAR C)))
		   (EQUAL (MEANING (CONS Z (CONS (CONS V C) D))
				   A)
			  (GET (SUB1 (CAR C))
			       (CDR (MEANING (CAR D) A))))).

    However this further simplifies, appealing to the lemma CDR-CONS,
    and unfolding the definitions of FORMP, LENGTH, ADD1, and EQUAL,
    to:

          T.

  Case 6.3.
          (IMPLIES
		(AND (NOT (LISTP C))
		     (FORMP (CONS Z
				  (CONS (CONS V C) (CONS W X1))))
		     (EQUAL Z 'GET)
		     (EQUAL V 'QUOTE)
		     (NOT (EQUAL (CAR C) 0))
		     (NUMBERP (CAR C)))
		(EQUAL (MEANING (CONS Z (CONS (CONS V C) (CONS W X1)))
				A)
		       (GET (SUB1 (CAR C))
			    (CDR (MEANING W A))))),

    which we further simplify, rewriting with CDR-CONS, ADD1-EQUAL,
    and CAR-CONS, and opening up FORMP, LENGTH, NUMBERP, and
    FORM-LSTP, to:

          T.

  Case 6.2.
          (IMPLIES
	   (AND (NOT (LISTP D))
		(NUMBERP C)
		(FORMP (CONS Z
			     (CONS (CONS V (CONS (ADD1 C) X1)) D)))
		(EQUAL Z 'GET)
		(EQUAL V 'QUOTE)
		(NOT (EQUAL (ADD1 C) 0)))
	   (EQUAL (MEANING (CONS Z
				 (CONS (CONS V (CONS (ADD1 C) X1)) D))
			   A)
		  (GET C (CDR (MEANING (CAR D) A))))),

    which further simplifies, applying CDR-CONS, and expanding the
    functions FORMP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 6.1.
          (IMPLIES
	       (AND (NUMBERP C)
		    (FORMP (CONS Z
				 (CONS (CONS V (CONS (ADD1 C) X1))
				       (CONS W Z1))))
		    (EQUAL Z 'GET)
		    (EQUAL V 'QUOTE)
		    (NOT (EQUAL (ADD1 C) 0)))
	       (EQUAL (MEANING (CONS Z
				     (CONS (CONS V (CONS (ADD1 C) X1))
					   (CONS W Z1)))
			       A)
		      (GET C (CDR (MEANING W A))))),

    which we further simplify, rewriting with CDR-CONS, ADD1-EQUAL,
    CAR-CONS, and SUB1-ADD1, and expanding the definitions of FORMP,
    LENGTH, NUMBERP, FORM-LSTP, MEANING, and GET, to:

          T.

Case 5. (IMPLIES (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'GET)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'QUOTE)
		      (EQUAL (CADADR X) 0))
		 (EQUAL (MEANING X A)
			(MEANING (LIST 'CAR (CADDR X)) A))),

  which we again simplify, applying CAR-CONS, and opening up MEANING,
  to:

        (IMPLIES (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'GET)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'QUOTE)
		      (EQUAL (CADADR X) 0))
		 (EQUAL (MEANING X A)
			(CAR (MEANING (CADDR X) A)))).

  Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V) to
  eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V)
  and (CDR V), W by (CONS V C) to eliminate (CAR W) and (CDR W), C by
  (CONS W X1) to eliminate (CAR C) and (CDR C), D by (CONS C Z1) to
  eliminate (CAR D) and (CDR D), and D by (CONS W X1) to eliminate
  (CAR D) and (CDR D).  We must thus prove five new goals:

  Case 5.5.
          (IMPLIES (AND (NOT (LISTP V))
			(FORMP (CONS Z V))
			(EQUAL Z 'GET)
			(LISTP (CAR V))
			(EQUAL (CAAR V) 'QUOTE)
			(EQUAL (CADAR V) 0))
		   (EQUAL (MEANING (CONS Z V) A)
			  (CAR (MEANING (CADR V) A)))).

    However this simplifies further, opening up FORMP, LENGTH, and
    EQUAL, to:

          T.

  Case 5.4.
          (IMPLIES (AND (NOT (LISTP D))
			(NOT (LISTP C))
			(FORMP (CONS Z (CONS (CONS V C) D)))
			(EQUAL Z 'GET)
			(EQUAL V 'QUOTE)
			(EQUAL (CAR C) 0))
		   (EQUAL (MEANING (CONS Z (CONS (CONS V C) D))
				   A)
			  (CAR (MEANING (CAR D) A)))),

    which we further simplify, rewriting with the lemma CDR-CONS, and
    expanding the definitions of FORMP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 5.3.
          (IMPLIES
		(AND (NOT (LISTP C))
		     (FORMP (CONS Z
				  (CONS (CONS V C) (CONS W X1))))
		     (EQUAL Z 'GET)
		     (EQUAL V 'QUOTE)
		     (EQUAL (CAR C) 0))
		(EQUAL (MEANING (CONS Z (CONS (CONS V C) (CONS W X1)))
				A)
		       (CAR (MEANING W A)))).

    This further simplifies, rewriting with the lemmas CDR-CONS,
    ADD1-EQUAL, and CAR-CONS, and expanding the functions FORMP,
    LENGTH, NUMBERP, and FORM-LSTP, to:

          T.

  Case 5.2.
          (IMPLIES
		(AND (NOT (LISTP D))
		     (FORMP (CONS Z
				  (CONS (CONS V (CONS W X1)) D)))
		     (EQUAL Z 'GET)
		     (EQUAL V 'QUOTE)
		     (EQUAL W 0))
		(EQUAL (MEANING (CONS Z (CONS (CONS V (CONS W X1)) D))
				A)
		       (CAR (MEANING (CAR D) A)))).

    This simplifies further, applying CDR-CONS, and expanding the
    functions FORMP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 5.1.
          (IMPLIES (AND (FORMP (CONS Z
				     (CONS (CONS V (CONS W X1))
					   (CONS C Z1))))
			(EQUAL Z 'GET)
			(EQUAL V 'QUOTE)
			(EQUAL W 0))
		   (EQUAL (MEANING (CONS Z
					 (CONS (CONS V (CONS W X1))
					       (CONS C Z1)))
				   A)
			  (CAR (MEANING C A)))),

    which we further simplify, applying the lemmas CDR-CONS,
    ADD1-EQUAL, and CAR-CONS, and opening up the definitions of FORMP,
    LENGTH, NUMBERP, FORM-LSTP, CONS, MEANING, CAR, EQUAL, and GET,
    to:

          T.

Case 4. (IMPLIES (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'GET)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'QUOTE)
		      (NOT (NUMBERP (CADADR X))))
		 (EQUAL (MEANING X A)
			(MEANING (LIST 'CAR (CADDR X)) A))),

  which we again simplify, appealing to the lemma CAR-CONS, and
  unfolding the function MEANING, to:

        (IMPLIES (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'GET)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'QUOTE)
		      (NOT (NUMBERP (CADADR X))))
		 (EQUAL (MEANING X A)
			(CAR (MEANING (CADDR X) A)))).

  Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
  eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V)
  and (CDR V), W by (CONS V C) to eliminate (CAR W) and (CDR W), C by
  (CONS W X1) to eliminate (CAR C) and (CDR C), D by (CONS C Z1) to
  eliminate (CAR D) and (CDR D), and D by (CONS W X1) to eliminate
  (CAR D) and (CDR D).  We thus obtain five new conjectures:

  Case 4.5.
          (IMPLIES (AND (NOT (LISTP V))
			(FORMP (CONS Z V))
			(EQUAL Z 'GET)
			(LISTP (CAR V))
			(EQUAL (CAAR V) 'QUOTE)
			(NOT (NUMBERP (CADAR V))))
		   (EQUAL (MEANING (CONS Z V) A)
			  (CAR (MEANING (CADR V) A)))).

    However this further simplifies, expanding the functions FORMP,
    LENGTH, and EQUAL, to:

          T.

  Case 4.4.
          (IMPLIES (AND (NOT (LISTP D))
			(NOT (LISTP C))
			(FORMP (CONS Z (CONS (CONS V C) D)))
			(EQUAL Z 'GET)
			(EQUAL V 'QUOTE)
			(NOT (NUMBERP (CAR C))))
		   (EQUAL (MEANING (CONS Z (CONS (CONS V C) D))
				   A)
			  (CAR (MEANING (CAR D) A)))).

    This further simplifies, applying CDR-CONS, and expanding the
    functions FORMP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 4.3.
          (IMPLIES
		(AND (NOT (LISTP C))
		     (FORMP (CONS Z
				  (CONS (CONS V C) (CONS W X1))))
		     (EQUAL Z 'GET)
		     (EQUAL V 'QUOTE)
		     (NOT (NUMBERP (CAR C))))
		(EQUAL (MEANING (CONS Z (CONS (CONS V C) (CONS W X1)))
				A)
		       (CAR (MEANING W A)))),

    which further simplifies, appealing to the lemmas CDR-CONS,
    ADD1-EQUAL, and CAR-CONS, and opening up FORMP, LENGTH, NUMBERP,
    and FORM-LSTP, to:

          T.

  Case 4.2.
          (IMPLIES
		(AND (NOT (LISTP D))
		     (FORMP (CONS Z
				  (CONS (CONS V (CONS W X1)) D)))
		     (EQUAL Z 'GET)
		     (EQUAL V 'QUOTE)
		     (NOT (NUMBERP W)))
		(EQUAL (MEANING (CONS Z (CONS (CONS V (CONS W X1)) D))
				A)
		       (CAR (MEANING (CAR D) A)))).

    This simplifies further, rewriting with CDR-CONS, and expanding
    the functions FORMP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 4.1.
          (IMPLIES (AND (FORMP (CONS Z
				     (CONS (CONS V (CONS W X1))
					   (CONS C Z1))))
			(EQUAL Z 'GET)
			(EQUAL V 'QUOTE)
			(NOT (NUMBERP W)))
		   (EQUAL (MEANING (CONS Z
					 (CONS (CONS V (CONS W X1))
					       (CONS C Z1)))
				   A)
			  (CAR (MEANING C A)))).

    However this simplifies further, rewriting with the lemmas
    CDR-CONS, ADD1-EQUAL, and CAR-CONS, and unfolding the definitions
    of FORMP, LENGTH, NUMBERP, FORM-LSTP, MEANING, and GET, to:

          T.

Case 3. (IMPLIES (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'GET)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'QUOTE)
		      (NOT (EQUAL (CADADR X) 0))
		      (NUMBERP (CADADR X)))
		 (FORMP (LIST 'GET
			      (LIST 'QUOTE (SUB1 (CADADR X)))
			      (LIST 'CDR (CADDR X))))).

  However this again simplifies, appealing to the lemmas CDR-CONS and
  CAR-CONS, and opening up FORMP, LENGTH, ADD1, EQUAL, FORM-LSTP, and
  LISTP, to:

        (IMPLIES (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'GET)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'QUOTE)
		      (NOT (EQUAL (CADADR X) 0))
		      (NUMBERP (CADADR X)))
		 (FORMP (CADDR X))).

  Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
  eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V)
  and (CDR V), W by (CONS V C) to eliminate (CAR W) and (CDR W), C by
  (CONS W X1) to eliminate (CAR C) and (CDR C), D by (CONS C Z1) to
  eliminate (CAR D) and (CDR D), and D by (CONS W X1) to eliminate
  (CAR D) and (CDR D).  This generates the following five new
  formulas:

  Case 3.5.
          (IMPLIES (AND (NOT (LISTP V))
			(FORMP (CONS Z V))
			(EQUAL Z 'GET)
			(LISTP (CAR V))
			(EQUAL (CAAR V) 'QUOTE)
			(NOT (EQUAL (CADAR V) 0))
			(NUMBERP (CADAR V)))
		   (FORMP (CADR V))).

    This simplifies further, opening up FORMP, LENGTH, and EQUAL, to:

          T.

  Case 3.4.
          (IMPLIES (AND (NOT (LISTP D))
			(NOT (LISTP C))
			(FORMP (CONS Z (CONS (CONS V C) D)))
			(EQUAL Z 'GET)
			(EQUAL V 'QUOTE)
			(NOT (EQUAL (CAR C) 0))
			(NUMBERP (CAR C)))
		   (FORMP (CAR D))),

    which further simplifies, applying CDR-CONS, and unfolding FORMP,
    LENGTH, ADD1, and EQUAL, to:

          T.

  Case 3.3.
          (IMPLIES (AND (NOT (LISTP C))
			(FORMP (CONS Z
				     (CONS (CONS V C) (CONS W X1))))
			(EQUAL Z 'GET)
			(EQUAL V 'QUOTE)
			(NOT (EQUAL (CAR C) 0))
			(NUMBERP (CAR C)))
		   (FORMP W)).

    However this simplifies further, applying CDR-CONS, ADD1-EQUAL,
    and CAR-CONS, and unfolding the definitions of FORMP, LENGTH,
    NUMBERP, and FORM-LSTP, to:

          T.

  Case 3.2.
          (IMPLIES (AND (NOT (LISTP D))
			(FORMP (CONS Z
				     (CONS (CONS V (CONS W X1)) D)))
			(EQUAL Z 'GET)
			(EQUAL V 'QUOTE)
			(NOT (EQUAL W 0))
			(NUMBERP W))
		   (FORMP (CAR D))).

    This simplifies further, applying CDR-CONS, and expanding the
    functions FORMP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 3.1.
          (IMPLIES (AND (FORMP (CONS Z
				     (CONS (CONS V (CONS W X1))
					   (CONS C Z1))))
			(EQUAL Z 'GET)
			(EQUAL V 'QUOTE)
			(NOT (EQUAL W 0))
			(NUMBERP W))
		   (FORMP C)).

    But this further simplifies, rewriting with CDR-CONS, ADD1-EQUAL,
    and CAR-CONS, and unfolding FORMP, LENGTH, NUMBERP, and FORM-LSTP,
    to:

          T.

Case 2. (IMPLIES (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'GET)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'QUOTE)
		      (EQUAL (CADADR X) 0))
		 (FORMP (LIST 'CAR (CADDR X)))),

  which again simplifies, rewriting with CDR-CONS and CAR-CONS, and
  expanding the functions FORMP, ADD1, LENGTH, EQUAL, FORM-LSTP, and
  LISTP, to the goal:

        (IMPLIES (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'GET)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'QUOTE)
		      (EQUAL (CADADR X) 0))
		 (FORMP (CADDR X))).

  Appealing to the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
  eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V)
  and (CDR V), W by (CONS V C) to eliminate (CAR W) and (CDR W), C by
  (CONS W X1) to eliminate (CAR C) and (CDR C), D by (CONS C Z1) to
  eliminate (CAR D) and (CDR D), and D by (CONS W X1) to eliminate
  (CAR D) and (CDR D).  We thus obtain five new goals:

  Case 2.5.
          (IMPLIES (AND (NOT (LISTP V))
			(FORMP (CONS Z V))
			(EQUAL Z 'GET)
			(LISTP (CAR V))
			(EQUAL (CAAR V) 'QUOTE)
			(EQUAL (CADAR V) 0))
		   (FORMP (CADR V))).

    This further simplifies, expanding the definitions of FORMP,
    LENGTH, and EQUAL, to:

          T.

  Case 2.4.
          (IMPLIES (AND (NOT (LISTP D))
			(NOT (LISTP C))
			(FORMP (CONS Z (CONS (CONS V C) D)))
			(EQUAL Z 'GET)
			(EQUAL V 'QUOTE)
			(EQUAL (CAR C) 0))
		   (FORMP (CAR D))).

    However this further simplifies, rewriting with the lemma
    CDR-CONS, and unfolding the definitions of FORMP, LENGTH, ADD1,
    and EQUAL, to:

          T.

  Case 2.3.
          (IMPLIES (AND (NOT (LISTP C))
			(FORMP (CONS Z
				     (CONS (CONS V C) (CONS W X1))))
			(EQUAL Z 'GET)
			(EQUAL V 'QUOTE)
			(EQUAL (CAR C) 0))
		   (FORMP W)),

    which further simplifies, applying the lemmas CDR-CONS,
    ADD1-EQUAL, and CAR-CONS, and expanding the functions FORMP,
    LENGTH, NUMBERP, and FORM-LSTP, to:

          T.

  Case 2.2.
          (IMPLIES (AND (NOT (LISTP D))
			(FORMP (CONS Z
				     (CONS (CONS V (CONS W X1)) D)))
			(EQUAL Z 'GET)
			(EQUAL V 'QUOTE)
			(EQUAL W 0))
		   (FORMP (CAR D))).

    However this simplifies further, rewriting with the lemma
    CDR-CONS, and expanding FORMP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 2.1.
          (IMPLIES (AND (FORMP (CONS Z
				     (CONS (CONS V (CONS W X1))
					   (CONS C Z1))))
			(EQUAL Z 'GET)
			(EQUAL V 'QUOTE)
			(EQUAL W 0))
		   (FORMP C)),

    which we further simplify, applying CDR-CONS, ADD1-EQUAL, and
    CAR-CONS, and unfolding the functions FORMP, LENGTH, NUMBERP, and
    FORM-LSTP, to:

          T.

Case 1. (IMPLIES (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'GET)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'QUOTE)
		      (NOT (NUMBERP (CADADR X))))
		 (FORMP (LIST 'CAR (CADDR X)))).

  This again simplifies, applying the lemmas CDR-CONS and CAR-CONS,
  and unfolding the definitions of FORMP, ADD1, LENGTH, EQUAL,
  FORM-LSTP, and LISTP, to the new conjecture:

        (IMPLIES (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'GET)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'QUOTE)
		      (NOT (NUMBERP (CADADR X))))
		 (FORMP (CADDR X))).

  Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
  eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V)
  and (CDR V), W by (CONS V C) to eliminate (CAR W) and (CDR W), C by
  (CONS W X1) to eliminate (CAR C) and (CDR C), D by (CONS C Z1) to
  eliminate (CAR D) and (CDR D), and D by (CONS W X1) to eliminate
  (CAR D) and (CDR D).  This produces five new formulas:

  Case 1.5.
          (IMPLIES (AND (NOT (LISTP V))
			(FORMP (CONS Z V))
			(EQUAL Z 'GET)
			(LISTP (CAR V))
			(EQUAL (CAAR V) 'QUOTE)
			(NOT (NUMBERP (CADAR V))))
		   (FORMP (CADR V))).

    However this further simplifies, expanding the functions FORMP,
    LENGTH, and EQUAL, to:

          T.

  Case 1.4.
          (IMPLIES (AND (NOT (LISTP D))
			(NOT (LISTP C))
			(FORMP (CONS Z (CONS (CONS V C) D)))
			(EQUAL Z 'GET)
			(EQUAL V 'QUOTE)
			(NOT (NUMBERP (CAR C))))
		   (FORMP (CAR D))),

    which we further simplify, applying CDR-CONS, and expanding the
    functions FORMP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 1.3.
          (IMPLIES (AND (NOT (LISTP C))
			(FORMP (CONS Z
				     (CONS (CONS V C) (CONS W X1))))
			(EQUAL Z 'GET)
			(EQUAL V 'QUOTE)
			(NOT (NUMBERP (CAR C))))
		   (FORMP W)).

    However this simplifies further, applying CDR-CONS, ADD1-EQUAL,
    and CAR-CONS, and unfolding FORMP, LENGTH, NUMBERP, and FORM-LSTP,
    to:

          T.

  Case 1.2.
          (IMPLIES (AND (NOT (LISTP D))
			(FORMP (CONS Z
				     (CONS (CONS V (CONS W X1)) D)))
			(EQUAL Z 'GET)
			(EQUAL V 'QUOTE)
			(NOT (NUMBERP W)))
		   (FORMP (CAR D))).

    However this simplifies further, rewriting with CDR-CONS, and
    opening up the definitions of FORMP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 1.1.
          (IMPLIES (AND (FORMP (CONS Z
				     (CONS (CONS V (CONS W X1))
					   (CONS C Z1))))
			(EQUAL Z 'GET)
			(EQUAL V 'QUOTE)
			(NOT (NUMBERP W)))
		   (FORMP C)).

    But this simplifies further, applying CDR-CONS, ADD1-EQUAL, and
    CAR-CONS, and unfolding the functions FORMP, LENGTH, NUMBERP, and
    FORM-LSTP, to:

          T.

Q.E.D.


[ 10.9180176 3.2779785 ]

CORRECTNESS-OF-GET-SIMPLIFIER 


(DEFN SET-SIMPLIFIER
      (X)
      (IF (AND (LISTP X)
	       (EQUAL (CAR X) 'SET)
	       (LISTP (CADR X))
	       (EQUAL (CAR (CADR X)) 'QUOTE))
	  (IF (ZEROP (CADR (CADR X)))
	      (LIST 'CONS
		    (CADDR X)
		    (LIST 'CDR (CADDDR X)))
	      (LIST 'CONS
		    (LIST 'CAR (CADDDR X))
		    (LIST 'SET
			  (LIST 'QUOTE (SUB1 (CADR (CADR X))))
			  (CADDR X)
			  (LIST 'CDR (CADDDR X)))))
	  X))
     Observe that:
      (OR (LISTP (SET-SIMPLIFIER X))
	  (EQUAL (SET-SIMPLIFIER X) X))
is a theorem.




[ 0.399983723 0.016015625 ]

SET-SIMPLIFIER 


(PROVE-LEMMA CORRECTNESS-OF-SET-SIMPLIFIER
	     ((META SET))
	     (IMPLIES (FORMP X)
		      (AND (EQUAL (MEANING X A)
				  (MEANING (SET-SIMPLIFIER X) A))
			   (FORMP (SET-SIMPLIFIER X)))))

WARNING:  META lemmas must be proved in a constructive history.  The
current history contains the nonconstructive axiom NUMBERP-CALL.  If
this metalemma is proved using unsound axioms you may get wiped out
by the application of the metafunction.

This formula simplifies, opening up the definitions of SET-SIMPLIFIER
and AND, to the following six new formulas:

Case 6. (IMPLIES
	  (AND (FORMP X)
	       (LISTP X)
	       (EQUAL (CAR X) 'SET)
	       (LISTP (CADR X))
	       (EQUAL (CAADR X) 'QUOTE)
	       (NOT (EQUAL (CADADR X) 0))
	       (NUMBERP (CADADR X)))
	  (EQUAL (MEANING X A)
		 (MEANING (LIST 'CONS
				(LIST 'CAR (CADDDR X))
				(LIST 'SET
				      (LIST 'QUOTE (SUB1 (CADADR X)))
				      (CADDR X)
				      (LIST 'CDR (CADDDR X))))
			  A))).

  But this simplifies again, applying CAR-CONS and CDR-CONS, and
  expanding MEANING, to the new conjecture:

        (IMPLIES (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'SET)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'QUOTE)
		      (NOT (EQUAL (CADADR X) 0))
		      (NUMBERP (CADADR X)))
		 (EQUAL (MEANING X A)
			(CONS (CAR (MEANING (CADDDR X) A))
			      (SET (SUB1 (CADADR X))
				   (MEANING (CADDR X) A)
				   (CDR (MEANING (CADDDR X) A)))))).

  Appealing to the lemmas SUB1-ELIM and CAR-CDR-ELIM, replace X by
  (CONS Z V) to eliminate (CAR X) and (CDR X), V by (CONS W D) to
  eliminate (CAR V) and (CDR V), W by (CONS V C) to eliminate (CAR W)
  and (CDR W), C by (CONS W X1) to eliminate (CAR C) and (CDR C), W
  by (ADD1 C) to eliminate (SUB1 W), D by (CONS W Z1) to eliminate
  (CAR D) and (CDR D), Z1 by (CONS D V1) to eliminate (CAR Z1) and
  (CDR Z1), D by (CONS W X1) to eliminate (CAR D) and (CDR D), and X1
  by (CONS D Z1) to eliminate (CAR X1) and (CDR X1).  We rely upon
  the type restriction lemma noted when SUB1 was introduced to
  restrict the new variables.  We would thus like to prove seven new
  conjectures:

  Case 6.7.
          (IMPLIES (AND (NOT (LISTP V))
			(FORMP (CONS Z V))
			(EQUAL Z 'SET)
			(LISTP (CAR V))
			(EQUAL (CAAR V) 'QUOTE)
			(NOT (EQUAL (CADAR V) 0))
			(NUMBERP (CADAR V)))
		   (EQUAL (MEANING (CONS Z V) A)
			  (CONS (CAR (MEANING (CADDR V) A))
				(SET (SUB1 (CADAR V))
				     (MEANING (CADR V) A)
				     (CDR (MEANING (CADDR V) A)))))),

    which further simplifies, unfolding the functions FORMP, LENGTH,
    and EQUAL, to:

          T.

  Case 6.6.
          (IMPLIES (AND (NOT (LISTP D))
			(NOT (LISTP C))
			(FORMP (CONS Z (CONS (CONS V C) D)))
			(EQUAL Z 'SET)
			(EQUAL V 'QUOTE)
			(NOT (EQUAL (CAR C) 0))
			(NUMBERP (CAR C)))
		   (EQUAL (MEANING (CONS Z (CONS (CONS V C) D))
				   A)
			  (CONS (CAR (MEANING (CADR D) A))
				(SET (SUB1 (CAR C))
				     (MEANING (CAR D) A)
				     (CDR (MEANING (CADR D) A)))))).

    However this further simplifies, appealing to the lemma CDR-CONS,
    and unfolding the definitions of FORMP, LENGTH, ADD1, and EQUAL,
    to:

          T.

  Case 6.5.
          (IMPLIES
		(AND (NOT (LISTP X1))
		     (NOT (LISTP C))
		     (FORMP (CONS Z
				  (CONS (CONS V C) (CONS W X1))))
		     (EQUAL Z 'SET)
		     (EQUAL V 'QUOTE)
		     (NOT (EQUAL (CAR C) 0))
		     (NUMBERP (CAR C)))
		(EQUAL (MEANING (CONS Z (CONS (CONS V C) (CONS W X1)))
				A)
		       (CONS (CAR (MEANING (CAR X1) A))
			     (SET (SUB1 (CAR C))
				  (MEANING W A)
				  (CDR (MEANING (CAR X1) A)))))),

    which we further simplify, rewriting with CDR-CONS, and opening
    up FORMP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 6.4.
          (IMPLIES (AND (NOT (LISTP C))
			(FORMP (CONS Z
				     (CONS (CONS V C)
					   (CONS W (CONS D Z1)))))
			(EQUAL Z 'SET)
			(EQUAL V 'QUOTE)
			(NOT (EQUAL (CAR C) 0))
			(NUMBERP (CAR C)))
		   (EQUAL (MEANING (CONS Z
					 (CONS (CONS V C)
					       (CONS W (CONS D Z1))))
				   A)
			  (CONS (CAR (MEANING D A))
				(SET (SUB1 (CAR C))
				     (MEANING W A)
				     (CDR (MEANING D A)))))),

    which further simplifies, applying CDR-CONS, ADD1-EQUAL, and
    CAR-CONS, and expanding the functions FORMP, LENGTH, NUMBERP, and
    FORM-LSTP, to:

          T.

  Case 6.3.
          (IMPLIES
	   (AND (NOT (LISTP D))
		(NUMBERP C)
		(FORMP (CONS Z
			     (CONS (CONS V (CONS (ADD1 C) X1)) D)))
		(EQUAL Z 'SET)
		(EQUAL V 'QUOTE)
		(NOT (EQUAL (ADD1 C) 0)))
	   (EQUAL (MEANING (CONS Z
				 (CONS (CONS V (CONS (ADD1 C) X1)) D))
			   A)
		  (CONS (CAR (MEANING (CADR D) A))
			(SET C
			     (MEANING (CAR D) A)
			     (CDR (MEANING (CADR D) A)))))),

    which we further simplify, rewriting with CDR-CONS, and expanding
    the definitions of FORMP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 6.2.
          (IMPLIES
	       (AND (NOT (LISTP Z1))
		    (NUMBERP C)
		    (FORMP (CONS Z
				 (CONS (CONS V (CONS (ADD1 C) X1))
				       (CONS W Z1))))
		    (EQUAL Z 'SET)
		    (EQUAL V 'QUOTE)
		    (NOT (EQUAL (ADD1 C) 0)))
	       (EQUAL (MEANING (CONS Z
				     (CONS (CONS V (CONS (ADD1 C) X1))
					   (CONS W Z1)))
			       A)
		      (CONS (CAR (MEANING (CAR Z1) A))
			    (SET C
				 (MEANING W A)
				 (CDR (MEANING (CAR Z1) A)))))),

    which we further simplify, applying CDR-CONS, and opening up
    FORMP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 6.1.
          (IMPLIES
	       (AND (NUMBERP C)
		    (FORMP (CONS Z
				 (CONS (CONS V (CONS (ADD1 C) X1))
				       (CONS W (CONS D V1)))))
		    (EQUAL Z 'SET)
		    (EQUAL V 'QUOTE)
		    (NOT (EQUAL (ADD1 C) 0)))
	       (EQUAL (MEANING (CONS Z
				     (CONS (CONS V (CONS (ADD1 C) X1))
					   (CONS W (CONS D V1))))
			       A)
		      (CONS (CAR (MEANING D A))
			    (SET C
				 (MEANING W A)
				 (CDR (MEANING D A)))))).

    But this simplifies further, rewriting with CDR-CONS, ADD1-EQUAL,
    CAR-CONS, and SUB1-ADD1, and expanding the functions FORMP,
    LENGTH, NUMBERP, FORM-LSTP, MEANING, and SET, to:

          T.

Case 5. (IMPLIES (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'SET)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'QUOTE)
		      (EQUAL (CADADR X) 0))
		 (EQUAL (MEANING X A)
			(MEANING (LIST 'CONS
				       (CADDR X)
				       (LIST 'CDR (CADDDR X)))
				 A))).

  However this simplifies again, rewriting with the lemmas CAR-CONS
  and CDR-CONS, and expanding the definition of MEANING, to the new
  conjecture:

        (IMPLIES (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'SET)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'QUOTE)
		      (EQUAL (CADADR X) 0))
		 (EQUAL (MEANING X A)
			(CONS (MEANING (CADDR X) A)
			      (CDR (MEANING (CADDDR X) A))))).

  Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
  eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V)
  and (CDR V), W by (CONS V C) to eliminate (CAR W) and (CDR W), C by
  (CONS W X1) to eliminate (CAR C) and (CDR C), D by (CONS C Z1) to
  eliminate (CAR D) and (CDR D), Z1 by (CONS D V1) to eliminate
  (CAR Z1) and (CDR Z1), D by (CONS X1 W) to eliminate (CDR D) and
  (CAR D), and W by (CONS D Z1) to eliminate (CAR W) and (CDR W).  We
  would thus like to prove the following seven new goals:

  Case 5.7.
          (IMPLIES (AND (NOT (LISTP V))
			(FORMP (CONS Z V))
			(EQUAL Z 'SET)
			(LISTP (CAR V))
			(EQUAL (CAAR V) 'QUOTE)
			(EQUAL (CADAR V) 0))
		   (EQUAL (MEANING (CONS Z V) A)
			  (CONS (MEANING (CADR V) A)
				(CDR (MEANING (CADDR V) A))))).

    This simplifies further, opening up the definitions of FORMP,
    LENGTH, and EQUAL, to:

          T.

  Case 5.6.
          (IMPLIES (AND (NOT (LISTP D))
			(NOT (LISTP C))
			(FORMP (CONS Z (CONS (CONS V C) D)))
			(EQUAL Z 'SET)
			(EQUAL V 'QUOTE)
			(EQUAL (CAR C) 0))
		   (EQUAL (MEANING (CONS Z (CONS (CONS V C) D))
				   A)
			  (CONS (MEANING (CAR D) A)
				(CDR (MEANING (CADR D) A))))),

    which we further simplify, applying CDR-CONS, and opening up the
    definitions of FORMP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 5.5.
          (IMPLIES
		(AND (NOT (LISTP W))
		     (NOT (LISTP C))
		     (FORMP (CONS Z
				  (CONS (CONS V C) (CONS X1 W))))
		     (EQUAL Z 'SET)
		     (EQUAL V 'QUOTE)
		     (EQUAL (CAR C) 0))
		(EQUAL (MEANING (CONS Z (CONS (CONS V C) (CONS X1 W)))
				A)
		       (CONS (MEANING X1 A)
			     (CDR (MEANING (CAR W) A))))),

    which we further simplify, applying CDR-CONS, and opening up the
    definitions of FORMP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 5.4.
          (IMPLIES (AND (NOT (LISTP C))
			(FORMP (CONS Z
				     (CONS (CONS V C)
					   (CONS X1 (CONS D Z1)))))
			(EQUAL Z 'SET)
			(EQUAL V 'QUOTE)
			(EQUAL (CAR C) 0))
		   (EQUAL (MEANING (CONS Z
					 (CONS (CONS V C)
					       (CONS X1 (CONS D Z1))))
				   A)
			  (CONS (MEANING X1 A)
				(CDR (MEANING D A))))),

    which we further simplify, appealing to the lemmas CDR-CONS,
    ADD1-EQUAL, and CAR-CONS, and unfolding the functions FORMP,
    LENGTH, NUMBERP, and FORM-LSTP, to:

          T.

  Case 5.3.
          (IMPLIES
		(AND (NOT (LISTP D))
		     (FORMP (CONS Z
				  (CONS (CONS V (CONS W X1)) D)))
		     (EQUAL Z 'SET)
		     (EQUAL V 'QUOTE)
		     (EQUAL W 0))
		(EQUAL (MEANING (CONS Z (CONS (CONS V (CONS W X1)) D))
				A)
		       (CONS (MEANING (CAR D) A)
			     (CDR (MEANING (CADR D) A))))).

    But this further simplifies, rewriting with the lemma CDR-CONS,
    and expanding the definitions of FORMP, LENGTH, ADD1, and EQUAL,
    to:

          T.

  Case 5.2.
          (IMPLIES (AND (NOT (LISTP Z1))
			(FORMP (CONS Z
				     (CONS (CONS V (CONS W X1))
					   (CONS C Z1))))
			(EQUAL Z 'SET)
			(EQUAL V 'QUOTE)
			(EQUAL W 0))
		   (EQUAL (MEANING (CONS Z
					 (CONS (CONS V (CONS W X1))
					       (CONS C Z1)))
				   A)
			  (CONS (MEANING C A)
				(CDR (MEANING (CAR Z1) A))))).

    This further simplifies, rewriting with the lemma CDR-CONS, and
    expanding the functions FORMP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 5.1.
          (IMPLIES (AND (FORMP (CONS Z
				     (CONS (CONS V (CONS W X1))
					   (CONS C (CONS D V1)))))
			(EQUAL Z 'SET)
			(EQUAL V 'QUOTE)
			(EQUAL W 0))
		   (EQUAL (MEANING (CONS Z
					 (CONS (CONS V (CONS W X1))
					       (CONS C (CONS D V1))))
				   A)
			  (CONS (MEANING C A)
				(CDR (MEANING D A))))),

    which we further simplify, applying the lemmas CDR-CONS,
    ADD1-EQUAL, and CAR-CONS, and expanding the functions FORMP,
    LENGTH, NUMBERP, FORM-LSTP, CONS, MEANING, CAR, EQUAL, and SET,
    to:

          T.

Case 4. (IMPLIES (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'SET)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'QUOTE)
		      (NOT (NUMBERP (CADADR X))))
		 (EQUAL (MEANING X A)
			(MEANING (LIST 'CONS
				       (CADDR X)
				       (LIST 'CDR (CADDDR X)))
				 A))),

  which again simplifies, rewriting with CAR-CONS and CDR-CONS, and
  expanding the definition of MEANING, to:

        (IMPLIES (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'SET)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'QUOTE)
		      (NOT (NUMBERP (CADADR X))))
		 (EQUAL (MEANING X A)
			(CONS (MEANING (CADDR X) A)
			      (CDR (MEANING (CADDDR X) A))))).

  Appealing to the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
  eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V)
  and (CDR V), W by (CONS V C) to eliminate (CAR W) and (CDR W), C by
  (CONS W X1) to eliminate (CAR C) and (CDR C), D by (CONS C Z1) to
  eliminate (CAR D) and (CDR D), Z1 by (CONS D V1) to eliminate
  (CAR Z1) and (CDR Z1), D by (CONS X1 W) to eliminate (CDR D) and
  (CAR D), and W by (CONS D Z1) to eliminate (CAR W) and (CDR W).  We
  thus obtain the following seven new formulas:

  Case 4.7.
          (IMPLIES (AND (NOT (LISTP V))
			(FORMP (CONS Z V))
			(EQUAL Z 'SET)
			(LISTP (CAR V))
			(EQUAL (CAAR V) 'QUOTE)
			(NOT (NUMBERP (CADAR V))))
		   (EQUAL (MEANING (CONS Z V) A)
			  (CONS (MEANING (CADR V) A)
				(CDR (MEANING (CADDR V) A))))),

    which further simplifies, unfolding FORMP, LENGTH, and EQUAL, to:

          T.

  Case 4.6.
          (IMPLIES (AND (NOT (LISTP D))
			(NOT (LISTP C))
			(FORMP (CONS Z (CONS (CONS V C) D)))
			(EQUAL Z 'SET)
			(EQUAL V 'QUOTE)
			(NOT (NUMBERP (CAR C))))
		   (EQUAL (MEANING (CONS Z (CONS (CONS V C) D))
				   A)
			  (CONS (MEANING (CAR D) A)
				(CDR (MEANING (CADR D) A))))),

    which further simplifies, rewriting with CDR-CONS, and unfolding
    the functions FORMP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 4.5.
          (IMPLIES
		(AND (NOT (LISTP W))
		     (NOT (LISTP C))
		     (FORMP (CONS Z
				  (CONS (CONS V C) (CONS X1 W))))
		     (EQUAL Z 'SET)
		     (EQUAL V 'QUOTE)
		     (NOT (NUMBERP (CAR C))))
		(EQUAL (MEANING (CONS Z (CONS (CONS V C) (CONS X1 W)))
				A)
		       (CONS (MEANING X1 A)
			     (CDR (MEANING (CAR W) A))))),

    which further simplifies, rewriting with CDR-CONS, and expanding
    FORMP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 4.4.
          (IMPLIES (AND (NOT (LISTP C))
			(FORMP (CONS Z
				     (CONS (CONS V C)
					   (CONS X1 (CONS D Z1)))))
			(EQUAL Z 'SET)
			(EQUAL V 'QUOTE)
			(NOT (NUMBERP (CAR C))))
		   (EQUAL (MEANING (CONS Z
					 (CONS (CONS V C)
					       (CONS X1 (CONS D Z1))))
				   A)
			  (CONS (MEANING X1 A)
				(CDR (MEANING D A))))).

    But this further simplifies, rewriting with CDR-CONS, ADD1-EQUAL,
    and CAR-CONS, and expanding the definitions of FORMP, LENGTH,
    NUMBERP, and FORM-LSTP, to:

          T.

  Case 4.3.
          (IMPLIES
		(AND (NOT (LISTP D))
		     (FORMP (CONS Z
				  (CONS (CONS V (CONS W X1)) D)))
		     (EQUAL Z 'SET)
		     (EQUAL V 'QUOTE)
		     (NOT (NUMBERP W)))
		(EQUAL (MEANING (CONS Z (CONS (CONS V (CONS W X1)) D))
				A)
		       (CONS (MEANING (CAR D) A)
			     (CDR (MEANING (CADR D) A))))),

    which we further simplify, rewriting with CDR-CONS, and unfolding
    the definitions of FORMP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 4.2.
          (IMPLIES (AND (NOT (LISTP Z1))
			(FORMP (CONS Z
				     (CONS (CONS V (CONS W X1))
					   (CONS C Z1))))
			(EQUAL Z 'SET)
			(EQUAL V 'QUOTE)
			(NOT (NUMBERP W)))
		   (EQUAL (MEANING (CONS Z
					 (CONS (CONS V (CONS W X1))
					       (CONS C Z1)))
				   A)
			  (CONS (MEANING C A)
				(CDR (MEANING (CAR Z1) A))))),

    which further simplifies, rewriting with CDR-CONS, and opening up
    FORMP, LENGTH, ADD1, and EQUAL, to:

          T.

  Case 4.1.
          (IMPLIES (AND (FORMP (CONS Z
				     (CONS (CONS V (CONS W X1))
					   (CONS C (CONS D V1)))))
			(EQUAL Z 'SET)
			(EQUAL V 'QUOTE)
			(NOT (NUMBERP W)))
		   (EQUAL (MEANING (CONS Z
					 (CONS (CONS V (CONS W X1))
					       (CONS C (CONS D V1))))
				   A)
			  (CONS (MEANING C A)
				(CDR (MEANING D A))))),

    which further simplifies, rewriting with CDR-CONS, ADD1-EQUAL,
    and CAR-CONS, and expanding FORMP, LENGTH, NUMBERP, FORM-LSTP,
    MEANING, and SET, to:

          T.

Case 3. (IMPLIES (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'SET)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'QUOTE)
		      (NOT (EQUAL (CADADR X) 0))
		      (NUMBERP (CADADR X)))
		 (FORMP (LIST 'CONS
			      (LIST 'CAR (CADDDR X))
			      (LIST 'SET
				    (LIST 'QUOTE (SUB1 (CADADR X)))
				    (CADDR X)
				    (LIST 'CDR (CADDDR X)))))),

  which we again simplify, applying CDR-CONS and CAR-CONS, and
  expanding the functions FORMP, LENGTH, ADD1, EQUAL, FORM-LSTP, and
  LISTP, to the following two new goals:

  Case 3.2.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'SET)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'QUOTE)
			(NOT (EQUAL (CADADR X) 0))
			(NUMBERP (CADADR X)))
		   (FORMP (CADDDR X))).

    Appealing to the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
    eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate
    (CAR V) and (CDR V), W by (CONS V C) to eliminate (CAR W) and
    (CDR W), C by (CONS W X1) to eliminate (CAR C) and (CDR C), D by
    (CONS Z1 C) to eliminate (CDR D) and (CAR D), C by (CONS D V1) to
    eliminate (CAR C) and (CDR C), D by (CONS X1 W) to eliminate
    (CDR D) and (CAR D), and W by (CONS D Z1) to eliminate (CAR W)
    and (CDR W).  We must thus prove the following seven new formulas:

    Case 3.2.7.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'SET)
			  (LISTP (CAR V))
			  (EQUAL (CAAR V) 'QUOTE)
			  (NOT (EQUAL (CADAR V) 0))
			  (NUMBERP (CADAR V)))
		     (FORMP (CADDR V))).

      However this further simplifies, opening up the functions FORMP,
      LENGTH, and EQUAL, to:

            T.

    Case 3.2.6.
            (IMPLIES (AND (NOT (LISTP D))
			  (NOT (LISTP C))
			  (FORMP (CONS Z (CONS (CONS V C) D)))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (EQUAL (CAR C) 0))
			  (NUMBERP (CAR C)))
		     (FORMP (CADR D))).

      But this further simplifies, rewriting with CDR-CONS, and
      opening up FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 3.2.5.
            (IMPLIES (AND (NOT (LISTP W))
			  (NOT (LISTP C))
			  (FORMP (CONS Z
				       (CONS (CONS V C) (CONS X1 W))))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (EQUAL (CAR C) 0))
			  (NUMBERP (CAR C)))
		     (FORMP (CAR W))),

      which further simplifies, applying CDR-CONS, and unfolding the
      definitions of FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 3.2.4.
            (IMPLIES (AND (NOT (LISTP C))
			  (FORMP (CONS Z
				       (CONS (CONS V C)
					     (CONS X1 (CONS D Z1)))))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (EQUAL (CAR C) 0))
			  (NUMBERP (CAR C)))
		     (FORMP D)).

      However this simplifies further, appealing to the lemmas
      CDR-CONS, ADD1-EQUAL, and CAR-CONS, and unfolding FORMP, LENGTH,
      NUMBERP, and FORM-LSTP, to:

            T.

    Case 3.2.3.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z
				       (CONS (CONS V (CONS W X1)) D)))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (EQUAL W 0))
			  (NUMBERP W))
		     (FORMP (CADR D))).

      However this further simplifies, applying the lemma CDR-CONS,
      and expanding the functions FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 3.2.2.
            (IMPLIES (AND (NOT (LISTP C))
			  (FORMP (CONS Z
				       (CONS (CONS V (CONS W X1))
					     (CONS Z1 C))))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (EQUAL W 0))
			  (NUMBERP W))
		     (FORMP (CAR C))).

      However this simplifies further, rewriting with the lemma
      CDR-CONS, and expanding FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 3.2.1.
            (IMPLIES (AND (FORMP (CONS Z
				       (CONS (CONS V (CONS W X1))
					     (CONS Z1 (CONS D V1)))))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (EQUAL W 0))
			  (NUMBERP W))
		     (FORMP D)),

      which we further simplify, applying CDR-CONS, ADD1-EQUAL, and
      CAR-CONS, and unfolding the functions FORMP, LENGTH, NUMBERP,
      and FORM-LSTP, to:

            T.

  Case 3.1.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'SET)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'QUOTE)
			(NOT (EQUAL (CADADR X) 0))
			(NUMBERP (CADADR X)))
		   (FORMP (CADDR X))).

    Appealing to the lemma CAR-CDR-ELIM, we now replace X by
    (CONS Z V) to eliminate (CAR X) and (CDR X), V by (CONS W D) to
    eliminate (CAR V) and (CDR V), W by (CONS V C) to eliminate
    (CAR W) and (CDR W), C by (CONS W X1) to eliminate (CAR C) and
    (CDR C), D by (CONS C Z1) to eliminate (CAR D) and (CDR D), and D
    by (CONS W X1) to eliminate (CAR D) and (CDR D).  This generates
    five new conjectures:

    Case 3.1.5.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'SET)
			  (LISTP (CAR V))
			  (EQUAL (CAAR V) 'QUOTE)
			  (NOT (EQUAL (CADAR V) 0))
			  (NUMBERP (CADAR V)))
		     (FORMP (CADR V))),

      which we further simplify, opening up the definitions of FORMP,
      LENGTH, and EQUAL, to:

            T.

    Case 3.1.4.
            (IMPLIES (AND (NOT (LISTP D))
			  (NOT (LISTP C))
			  (FORMP (CONS Z (CONS (CONS V C) D)))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (EQUAL (CAR C) 0))
			  (NUMBERP (CAR C)))
		     (FORMP (CAR D))).

      However this further simplifies, rewriting with CDR-CONS, and
      expanding FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 3.1.3.
            (IMPLIES (AND (NOT (LISTP C))
			  (FORMP (CONS Z
				       (CONS (CONS V C) (CONS W X1))))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (EQUAL (CAR C) 0))
			  (NUMBERP (CAR C)))
		     (FORMP W)).

      However this further simplifies, applying CDR-CONS, ADD1-EQUAL,
      and CAR-CONS, and opening up the definitions of FORMP, LENGTH,
      NUMBERP, and FORM-LSTP, to:

            T.

    Case 3.1.2.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z
				       (CONS (CONS V (CONS W X1)) D)))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (EQUAL W 0))
			  (NUMBERP W))
		     (FORMP (CAR D))),

      which we further simplify, applying CDR-CONS, and opening up
      FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 3.1.1.
            (IMPLIES (AND (FORMP (CONS Z
				       (CONS (CONS V (CONS W X1))
					     (CONS C Z1))))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (EQUAL W 0))
			  (NUMBERP W))
		     (FORMP C)).

      However this simplifies further, rewriting with CDR-CONS,
      ADD1-EQUAL, and CAR-CONS, and unfolding the definitions of
      FORMP, LENGTH, NUMBERP, and FORM-LSTP, to:

            T.

Case 2. (IMPLIES (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'SET)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'QUOTE)
		      (EQUAL (CADADR X) 0))
		 (FORMP (LIST 'CONS
			      (CADDR X)
			      (LIST 'CDR (CADDDR X))))).

  However this simplifies again, applying the lemmas CDR-CONS and
  CAR-CONS, and opening up the functions FORMP, LENGTH, ADD1, EQUAL,
  FORM-LSTP, and LISTP, to two new conjectures:

  Case 2.2.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'SET)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'QUOTE)
			(EQUAL (CADADR X) 0))
		   (FORMP (CADDR X))).

    Appealing to the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
    eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate
    (CAR V) and (CDR V), W by (CONS V C) to eliminate (CAR W) and
    (CDR W), C by (CONS W X1) to eliminate (CAR C) and (CDR C), D by
    (CONS C Z1) to eliminate (CAR D) and (CDR D), and D by
    (CONS W X1) to eliminate (CAR D) and (CDR D).  We thus obtain the
    following five new formulas:

    Case 2.2.5.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'SET)
			  (LISTP (CAR V))
			  (EQUAL (CAAR V) 'QUOTE)
			  (EQUAL (CADAR V) 0))
		     (FORMP (CADR V))).

      But this further simplifies, expanding the definitions of FORMP,
      LENGTH, and EQUAL, to:

            T.

    Case 2.2.4.
            (IMPLIES (AND (NOT (LISTP D))
			  (NOT (LISTP C))
			  (FORMP (CONS Z (CONS (CONS V C) D)))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (EQUAL (CAR C) 0))
		     (FORMP (CAR D))),

      which further simplifies, applying the lemma CDR-CONS, and
      opening up FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 2.2.3.
            (IMPLIES (AND (NOT (LISTP C))
			  (FORMP (CONS Z
				       (CONS (CONS V C) (CONS W X1))))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (EQUAL (CAR C) 0))
		     (FORMP W)).

      However this simplifies further, applying the lemmas CDR-CONS,
      ADD1-EQUAL, and CAR-CONS, and unfolding FORMP, LENGTH, NUMBERP,
      and FORM-LSTP, to:

            T.

    Case 2.2.2.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z
				       (CONS (CONS V (CONS W X1)) D)))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (EQUAL W 0))
		     (FORMP (CAR D))),

      which further simplifies, rewriting with CDR-CONS, and opening
      up the definitions of FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 2.2.1.
            (IMPLIES (AND (FORMP (CONS Z
				       (CONS (CONS V (CONS W X1))
					     (CONS C Z1))))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (EQUAL W 0))
		     (FORMP C)).

      But this further simplifies, rewriting with CDR-CONS,
      ADD1-EQUAL, and CAR-CONS, and expanding the definitions of
      FORMP, LENGTH, NUMBERP, and FORM-LSTP, to:

            T.

  Case 2.1.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'SET)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'QUOTE)
			(EQUAL (CADADR X) 0))
		   (FORMP (CADDDR X))).

    Appealing to the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
    eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate
    (CAR V) and (CDR V), W by (CONS V C) to eliminate (CAR W) and
    (CDR W), C by (CONS W X1) to eliminate (CAR C) and (CDR C), D by
    (CONS Z1 C) to eliminate (CDR D) and (CAR D), C by (CONS D V1) to
    eliminate (CAR C) and (CDR C), D by (CONS X1 W) to eliminate
    (CDR D) and (CAR D), and W by (CONS D Z1) to eliminate (CAR W)
    and (CDR W).  This generates seven new formulas:

    Case 2.1.7.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'SET)
			  (LISTP (CAR V))
			  (EQUAL (CAAR V) 'QUOTE)
			  (EQUAL (CADAR V) 0))
		     (FORMP (CADDR V))),

      which we further simplify, unfolding the functions FORMP,
      LENGTH, and EQUAL, to:

            T.

    Case 2.1.6.
            (IMPLIES (AND (NOT (LISTP D))
			  (NOT (LISTP C))
			  (FORMP (CONS Z (CONS (CONS V C) D)))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (EQUAL (CAR C) 0))
		     (FORMP (CADR D))).

      But this further simplifies, applying the lemma CDR-CONS, and
      unfolding the definitions of FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 2.1.5.
            (IMPLIES (AND (NOT (LISTP W))
			  (NOT (LISTP C))
			  (FORMP (CONS Z
				       (CONS (CONS V C) (CONS X1 W))))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (EQUAL (CAR C) 0))
		     (FORMP (CAR W))),

      which further simplifies, applying CDR-CONS, and opening up
      FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 2.1.4.
            (IMPLIES (AND (NOT (LISTP C))
			  (FORMP (CONS Z
				       (CONS (CONS V C)
					     (CONS X1 (CONS D Z1)))))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (EQUAL (CAR C) 0))
		     (FORMP D)).

      This simplifies further, applying CDR-CONS, ADD1-EQUAL, and
      CAR-CONS, and unfolding the definitions of FORMP, LENGTH,
      NUMBERP, and FORM-LSTP, to:

            T.

    Case 2.1.3.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z
				       (CONS (CONS V (CONS W X1)) D)))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (EQUAL W 0))
		     (FORMP (CADR D))).

      However this further simplifies, applying CDR-CONS, and opening
      up the functions FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 2.1.2.
            (IMPLIES (AND (NOT (LISTP C))
			  (FORMP (CONS Z
				       (CONS (CONS V (CONS W X1))
					     (CONS Z1 C))))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (EQUAL W 0))
		     (FORMP (CAR C))).

      This further simplifies, rewriting with CDR-CONS, and opening
      up the functions FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 2.1.1.
            (IMPLIES (AND (FORMP (CONS Z
				       (CONS (CONS V (CONS W X1))
					     (CONS Z1 (CONS D V1)))))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (EQUAL W 0))
		     (FORMP D)),

      which further simplifies, rewriting with the lemmas CDR-CONS,
      ADD1-EQUAL, and CAR-CONS, and opening up FORMP, LENGTH, NUMBERP,
      and FORM-LSTP, to:

            T.

Case 1. (IMPLIES (AND (FORMP X)
		      (LISTP X)
		      (EQUAL (CAR X) 'SET)
		      (LISTP (CADR X))
		      (EQUAL (CAADR X) 'QUOTE)
		      (NOT (NUMBERP (CADADR X))))
		 (FORMP (LIST 'CONS
			      (CADDR X)
			      (LIST 'CDR (CADDDR X))))).

  However this again simplifies, applying CDR-CONS and CAR-CONS, and
  expanding the functions FORMP, LENGTH, ADD1, EQUAL, FORM-LSTP, and
  LISTP, to two new formulas:

  Case 1.2.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'SET)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'QUOTE)
			(NOT (NUMBERP (CADADR X))))
		   (FORMP (CADDR X))).

    Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to
    eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate
    (CAR V) and (CDR V), W by (CONS V C) to eliminate (CAR W) and
    (CDR W), C by (CONS W X1) to eliminate (CAR C) and (CDR C), D by
    (CONS C Z1) to eliminate (CAR D) and (CDR D), and D by
    (CONS W X1) to eliminate (CAR D) and (CDR D).  We must thus prove
    five new goals:

    Case 1.2.5.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'SET)
			  (LISTP (CAR V))
			  (EQUAL (CAAR V) 'QUOTE)
			  (NOT (NUMBERP (CADAR V))))
		     (FORMP (CADR V))),

      which we further simplify, expanding the definitions of FORMP,
      LENGTH, and EQUAL, to:

            T.

    Case 1.2.4.
            (IMPLIES (AND (NOT (LISTP D))
			  (NOT (LISTP C))
			  (FORMP (CONS Z (CONS (CONS V C) D)))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (NUMBERP (CAR C))))
		     (FORMP (CAR D))).

      But this further simplifies, applying CDR-CONS, and expanding
      the functions FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 1.2.3.
            (IMPLIES (AND (NOT (LISTP C))
			  (FORMP (CONS Z
				       (CONS (CONS V C) (CONS W X1))))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (NUMBERP (CAR C))))
		     (FORMP W)).

      This simplifies further, rewriting with CDR-CONS, ADD1-EQUAL,
      and CAR-CONS, and opening up the definitions of FORMP, LENGTH,
      NUMBERP, and FORM-LSTP, to:

            T.

    Case 1.2.2.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z
				       (CONS (CONS V (CONS W X1)) D)))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (NUMBERP W)))
		     (FORMP (CAR D))),

      which we further simplify, rewriting with the lemma CDR-CONS,
      and unfolding the functions FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 1.2.1.
            (IMPLIES (AND (FORMP (CONS Z
				       (CONS (CONS V (CONS W X1))
					     (CONS C Z1))))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (NUMBERP W)))
		     (FORMP C)).

      However this simplifies further, rewriting with the lemmas
      CDR-CONS, ADD1-EQUAL, and CAR-CONS, and expanding FORMP, LENGTH,
      NUMBERP, and FORM-LSTP, to:

            T.

  Case 1.1.
          (IMPLIES (AND (FORMP X)
			(LISTP X)
			(EQUAL (CAR X) 'SET)
			(LISTP (CADR X))
			(EQUAL (CAADR X) 'QUOTE)
			(NOT (NUMBERP (CADADR X))))
		   (FORMP (CADDDR X))).

    Applying the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V)
    to eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate
    (CAR V) and (CDR V), W by (CONS V C) to eliminate (CAR W) and
    (CDR W), C by (CONS W X1) to eliminate (CAR C) and (CDR C), D by
    (CONS Z1 C) to eliminate (CDR D) and (CAR D), C by (CONS D V1) to
    eliminate (CAR C) and (CDR C), D by (CONS X1 W) to eliminate
    (CDR D) and (CAR D), and W by (CONS D Z1) to eliminate (CAR W)
    and (CDR W).  The result is seven new formulas:

    Case 1.1.7.
            (IMPLIES (AND (NOT (LISTP V))
			  (FORMP (CONS Z V))
			  (EQUAL Z 'SET)
			  (LISTP (CAR V))
			  (EQUAL (CAAR V) 'QUOTE)
			  (NOT (NUMBERP (CADAR V))))
		     (FORMP (CADDR V))).

      This simplifies further, opening up the functions FORMP, LENGTH,
      and EQUAL, to:

            T.

    Case 1.1.6.
            (IMPLIES (AND (NOT (LISTP D))
			  (NOT (LISTP C))
			  (FORMP (CONS Z (CONS (CONS V C) D)))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (NUMBERP (CAR C))))
		     (FORMP (CADR D))).

      This simplifies further, applying CDR-CONS, and unfolding FORMP,
      LENGTH, ADD1, and EQUAL, to:

            T.

    Case 1.1.5.
            (IMPLIES (AND (NOT (LISTP W))
			  (NOT (LISTP C))
			  (FORMP (CONS Z
				       (CONS (CONS V C) (CONS X1 W))))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (NUMBERP (CAR C))))
		     (FORMP (CAR W))),

      which we further simplify, applying the lemma CDR-CONS, and
      expanding the definitions of FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 1.1.4.
            (IMPLIES (AND (NOT (LISTP C))
			  (FORMP (CONS Z
				       (CONS (CONS V C)
					     (CONS X1 (CONS D Z1)))))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (NUMBERP (CAR C))))
		     (FORMP D)).

      But this further simplifies, applying CDR-CONS, ADD1-EQUAL, and
      CAR-CONS, and unfolding the functions FORMP, LENGTH, NUMBERP,
      and FORM-LSTP, to:

            T.

    Case 1.1.3.
            (IMPLIES (AND (NOT (LISTP D))
			  (FORMP (CONS Z
				       (CONS (CONS V (CONS W X1)) D)))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (NUMBERP W)))
		     (FORMP (CADR D))),

      which we further simplify, rewriting with CDR-CONS, and
      unfolding FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 1.1.2.
            (IMPLIES (AND (NOT (LISTP C))
			  (FORMP (CONS Z
				       (CONS (CONS V (CONS W X1))
					     (CONS Z1 C))))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (NUMBERP W)))
		     (FORMP (CAR C))),

      which we further simplify, rewriting with CDR-CONS, and
      expanding the functions FORMP, LENGTH, ADD1, and EQUAL, to:

            T.

    Case 1.1.1.
            (IMPLIES (AND (FORMP (CONS Z
				       (CONS (CONS V (CONS W X1))
					     (CONS Z1 (CONS D V1)))))
			  (EQUAL Z 'SET)
			  (EQUAL V 'QUOTE)
			  (NOT (NUMBERP W)))
		     (FORMP D)),

      which further simplifies, applying CDR-CONS, ADD1-EQUAL, and
      CAR-CONS, and unfolding FORMP, LENGTH, NUMBERP, and FORM-LSTP,
      to:

            T.

Q.E.D.


[ 17.221875 5.06513673 ]

CORRECTNESS-OF-SET-SIMPLIFIER 


(PROVE-LEMMA LENGTH-5
	     (REWRITE)
	     (IMPLIES (EQUAL (CADDDDR X) '(JUMPA 1.))
		      (EQUAL (LENGTH X)
			     (PLUS 5. (LENGTH (CDDDDDR X)))))
	     NIL)
This formula simplifies, expanding the function LENGTH, to six new
formulas:

Case 6. (IMPLIES (AND (EQUAL (CADDDDR X) '(JUMPA 1))
		      (NOT (LISTP X)))
		 (EQUAL 0
			(PLUS 5 (LENGTH (CDDDDDR X))))).

  This simplifies again, applying CDR-NLISTP, and unfolding the
  functions CDR, CAR, and EQUAL, to:

        T.

Case 5. (IMPLIES (AND (EQUAL (CADDDDR X) '(JUMPA 1))
		      (LISTP X)
		      (LISTP (CDR X))
		      (NOT (LISTP (CDDR X))))
		 (EQUAL 2
			(PLUS 5 (LENGTH (CDDDDDR X))))),

  which we again simplify, rewriting with CDR-NLISTP, and unfolding
  the definitions of CDR, CAR, and EQUAL, to:

        T.

Case 4. (IMPLIES (AND (EQUAL (CADDDDR X) '(JUMPA 1))
		      (LISTP X)
		      (LISTP (CDR X))
		      (LISTP (CDDR X))
		      (LISTP (CDDDR X))
		      (NOT (LISTP (CDDDDR X))))
		 (EQUAL 4
			(PLUS 5 (LENGTH (CDDDDDR X))))).

  This simplifies again, applying CAR-NLISTP, and opening up EQUAL,
  to:

        T.

Case 3. (IMPLIES
	 (AND (EQUAL (CADDDDR X) '(JUMPA 1))
	      (LISTP X)
	      (LISTP (CDR X))
	      (LISTP (CDDR X))
	      (LISTP (CDDDR X))
	      (LISTP (CDDDDR X)))
	 (EQUAL
	       (ADD1 (ADD1 (ADD1 (ADD1 (ADD1 (LENGTH (CDDDDDR X)))))))
	       (PLUS 5 (LENGTH (CDDDDDR X))))),

  which we again simplify, using linear arithmetic, to:

        T.

Case 2. (IMPLIES (AND (EQUAL (CADDDDR X) '(JUMPA 1))
		      (LISTP X)
		      (LISTP (CDR X))
		      (LISTP (CDDR X))
		      (NOT (LISTP (CDDDR X))))
		 (EQUAL 3
			(PLUS 5 (LENGTH (CDDDDDR X))))).

  However this again simplifies, appealing to the lemma CDR-NLISTP,
  and unfolding the definitions of CAR and EQUAL, to:

        T.

Case 1. (IMPLIES (AND (EQUAL (CADDDDR X) '(JUMPA 1))
		      (LISTP X)
		      (NOT (LISTP (CDR X))))
		 (EQUAL 1
			(PLUS 5 (LENGTH (CDDDDDR X))))),

  which we again simplify, rewriting with CDR-NLISTP, and opening up
  CDR, CAR, and EQUAL, to:

        T.

Q.E.D.


[ 0.54098307 0.249007162 ]

LENGTH-5 


(PROVE-LEMMA LENGTH-CONS6
 (REWRITE)
 (EQUAL (LENGTH (CONS X1
		      (CONS X2
			    (CONS X3
				  (CONS X4 (CONS X5 (CONS X6 X7)))))))
	(PLUS 6. (LENGTH X7))))
This simplifies, applying the lemma CDR-CONS, and expanding the
definition of LENGTH, to:

      (EQUAL (ADD1 (ADD1 (ADD1 (ADD1 (ADD1 (ADD1 (LENGTH X7)))))))
	     (PLUS 6 (LENGTH X7))).

But this simplifies again, using linear arithmetic, to:

      T.

Q.E.D.


[ 0.491992187 0.0400227862 ]

LENGTH-CONS6 


(PROVE-LEMMA EXECUTE1-1
 (REWRITE)
 (IMPLIES
  ( LEQ 6. MAX)
  (EQUAL
   (EXECUTE1 1.
	     (CONS '(MOVEI 7. 0.)
		   (CONS '(SKIPNE 6.)
			 (CONS '(STOP)
			       (CONS '(ADD 7. 6.)
				     (CONS '(SUBI 6. 1.)
					   (CONS '(JUMPA 1.) L))))))
	     MAX)
   (IF
     (ZEROP (CAR L))
     (EXECUTE1 2.
	       (CONS '(MOVEI 7. 0.)
		     (CONS '(SKIPNE 6.)
			   (CONS '(STOP)
				 (CONS '(ADD 7. 6.)
				       (CONS '(SUBI 6. 1.)
					     (CONS '(JUMPA 1.) L))))))
	       MAX)
     (EXECUTE1 3.
	       (CONS '(MOVEI 7. 0.)
		     (CONS '(SKIPNE 6.)
			   (CONS '(STOP)
				 (CONS '(ADD 7. 6.)
				       (CONS '(SUBI 6. 1.)
					     (CONS '(JUMPA 1.) L))))))
	       MAX))))
 NIL)
This conjecture simplifies, applying CAR-CONS, CDR-CONS, and
CORRECTNESS-OF-GET-SIMPLIFIER, and unfolding the functions ADD1, CDR,
CAR, EQUAL, EXECUTE1, and ZEROP, to the new formula:

      (IMPLIES
       (AND ( LEQ 6 MAX)
	    (NOT (EQUAL (CAR L) 0))
	    (NUMBERP (CAR L))
	    ( LEQ MAX 1))
       (EQUAL
	(LIST F
	      (CONS '(MOVEI 7 0)
		    (CONS '(SKIPNE 6)
			  (CONS '(STOP)
				(CONS '(ADD 7 6)
				      (CONS '(SUBI 6 1)
					    (CONS '(JUMPA 1) L)))))))
	(EXECUTE1 3
		(CONS '(MOVEI 7 0)
		      (CONS '(SKIPNE 6)
			    (CONS '(STOP)
				  (CONS '(ADD 7 6)
					(CONS '(SUBI 6 1)
					      (CONS '(JUMPA 1) L))))))
		MAX))).

This again simplifies, using linear arithmetic, to:

      T.

Q.E.D.


[ 4.74405926 0.088948567 ]

EXECUTE1-1 


(PROVE-LEMMA EXECUTE1-3
 (REWRITE)
 (IMPLIES
  ( LEQ 6. MAX)
  (EQUAL
   (EXECUTE1 3.
	     (CONS '(MOVEI 7. 0.)
		   (CONS '(SKIPNE 6.)
			 (CONS '(STOP)
			       (CONS '(ADD 7. 6.)
				     (CONS '(SUBI 6. 1.)
					   (CONS '(JUMPA 1.) L))))))
	     MAX)
   (EXECUTE1 4.
    (CONS
     '(MOVEI 7. 0.)
     (CONS '(SKIPNE 6.)
	   (CONS '(STOP)
		 (CONS '(ADD 7. 6.)
		       (CONS '(SUBI 6. 1.)
			     (CONS '(JUMPA 1.)
				   (CONS (CAR L)
					 (CONS (PLUS (CAR L) (CADR L))
					       (CDDR L)))))))))
    MAX))))
This conjecture simplifies, rewriting with the lemmas
CORRECTNESS-OF-SET-SIMPLIFIER, CAR-CONS, CDR-CONS, and
CORRECTNESS-OF-GET-SIMPLIFIER, and unfolding the functions CDR, ADD1,
CAR, EQUAL, and EXECUTE1, to:

      (IMPLIES
       (AND ( LEQ 6 MAX) ( LEQ MAX 3))
       (EQUAL
	(LIST F
	      (CONS '(MOVEI 7 0)
		    (CONS '(SKIPNE 6)
			  (CONS '(STOP)
				(CONS '(ADD 7 6)
				      (CONS '(SUBI 6 1)
					    (CONS '(JUMPA 1) L)))))))
	(EXECUTE1 4
	 (CONS
	  '(MOVEI 7 0)
	  (CONS
	   '(SKIPNE 6)
	   (CONS '(STOP)
		 (CONS '(ADD 7 6)
		       (CONS '(SUBI 6 1)
			     (CONS '(JUMPA 1)
				   (CONS (CAR L)
					 (CONS (PLUS (CAR L) (CADR L))
					       (CDDR L)))))))))
	 MAX))),

which again simplifies, using linear arithmetic, to:

      T.

Q.E.D.


[ 13.2799642 0.091031901 ]

EXECUTE1-3 


(PROVE-LEMMA EXECUTE1-4
 (REWRITE)
 (IMPLIES
  ( LEQ 6. MAX)
  (EQUAL
   (EXECUTE1 4.
	     (CONS '(MOVEI 7. 0.)
		   (CONS '(SKIPNE 6.)
			 (CONS '(STOP)
			       (CONS '(ADD 7. 6.)
				     (CONS '(SUBI 6. 1.)
					   (CONS '(JUMPA 1.) L))))))
	     MAX)
   (EXECUTE1 5.
     (CONS '(MOVEI 7. 0.)
	   (CONS '(SKIPNE 6.)
		 (CONS '(STOP)
		       (CONS '(ADD 7. 6.)
			     (CONS '(SUBI 6. 1.)
				   (CONS '(JUMPA 1.)
					 (CONS (DIFFERENCE (CAR L) 1.)
					       (CDR L))))))))
     MAX))))
This conjecture can be simplified, using the abbreviations NOT,
IMPLIES, and DIFFERENCE-1, to:

      (IMPLIES
       ( LEQ 6 MAX)
       (EQUAL
	(EXECUTE1 4
		(CONS '(MOVEI 7 0)
		      (CONS '(SKIPNE 6)
			    (CONS '(STOP)
				  (CONS '(ADD 7 6)
					(CONS '(SUBI 6 1)
					      (CONS '(JUMPA 1) L))))))
		MAX)
	(EXECUTE1 5
	 (CONS
	  '(MOVEI 7 0)
	  (CONS
	   '(SKIPNE 6)
	   (CONS '(STOP)
		 (CONS '(ADD 7 6)
		       (CONS '(SUBI 6 1)
			     (CONS '(JUMPA 1)
				   (CONS (SUB1 (CAR L)) (CDR L))))))))
	 MAX))),

which simplifies, rewriting with CORRECTNESS-OF-SET-SIMPLIFIER,
DIFFERENCE-1, CAR-CONS, CDR-CONS, and CORRECTNESS-OF-GET-SIMPLIFIER,
and opening up the functions CDR, ADD1, CAR, EQUAL, and EXECUTE1, to
two new formulas:

Case 2. (IMPLIES
	 (AND ( LEQ 6 MAX)
	      ( LEQ MAX 5)
	      ( LEQ MAX 4))
	 (EQUAL
	  (LIST F
	       (CONS '(MOVEI 7 0)
		     (CONS '(SKIPNE 6)
			   (CONS '(STOP)
				 (CONS '(ADD 7 6)
				       (CONS '(SUBI 6 1)
					     (CONS '(JUMPA 1) L)))))))
	  (LIST F
	   (CONS
		'(MOVEI 7 0)
		(CONS '(SKIPNE 6)
		      (CONS '(STOP)
			    (CONS '(ADD 7 6)
				  (CONS '(SUBI 6 1)
					(CONS '(JUMPA 1)
					      (CONS (SUB1 (CAR L))
						    (CDR L))))))))))).

  This again simplifies, using linear arithmetic, to:

        T.

Case 1. (IMPLIES
	 (AND ( LEQ 6 MAX)
	      (LESSP 5 MAX)
	      ( LEQ MAX 4))
	 (EQUAL
	  (LIST F
	       (CONS '(MOVEI 7 0)
		     (CONS '(SKIPNE 6)
			   (CONS '(STOP)
				 (CONS '(ADD 7 6)
				       (CONS '(SUBI 6 1)
					     (CONS '(JUMPA 1) L)))))))
	  (LIST 1
	   (CONS
		'(MOVEI 7 0)
		(CONS '(SKIPNE 6)
		      (CONS '(STOP)
			    (CONS '(ADD 7 6)
				  (CONS '(SUBI 6 1)
					(CONS '(JUMPA 1)
					      (CONS (SUB1 (CAR L))
						    (CDR L))))))))))),

  which we again simplify, using linear arithmetic, to:

        T.

Q.E.D.


[ 2.01401368 0.206998698 ]

EXECUTE1-4 


(PROVE-LEMMA EXECUTE1-OPENED-UP
 (REWRITE)
 (IMPLIES
  (AND ( LEQ 6. MAX)
       (EQUAL (CAR MEM) '(MOVEI 7. 0.))
       (EQUAL (CADR MEM) '(SKIPNE 6.))
       (EQUAL (CADDR MEM) '(STOP))
       (EQUAL (CADDDR MEM) '(ADD 7. 6.))
       (EQUAL (CADDDDR MEM) '(SUBI 6. 1.))
       (EQUAL (CADDDDDR MEM) '(JUMPA 1.)))
  (EQUAL
   (EXECUTE1 1. MEM MAX)
   (IF
    (ZEROP (CADDDDDDR MEM))
    (LIST F
	  (CONS '(MOVEI 7. 0.)
		(CONS '(SKIPNE 6.)
		      (CONS '(STOP)
			    (CONS '(ADD 7. 6.)
				  (CONS '(SUBI 6. 1.)
					(CONS '(JUMPA 1.)
					      (CDDDDDDR MEM))))))))
    (LIST 1.
     (CONS
      '(MOVEI 7. 0.)
      (CONS
       '(SKIPNE 6.)
       (CONS
	   '(STOP)
	   (CONS '(ADD 7. 6.)
		 (CONS '(SUBI 6. 1.)
		       (CONS '(JUMPA 1.)
			     (CONS (SUB1 (CADDDDDDR MEM))
				   (CONS (PLUS (CADDDDDDR MEM)
					       (CADDDDDDDR MEM))
					 (CDDDDDDDDR MEM))))))))))))))
This formula simplifies, rewriting with COMMUTATIVITY-OF-PLUS, and
unfolding the functions ZEROP and PLUS, to three new conjectures:

Case 3. (IMPLIES
	 (AND ( LEQ 6 MAX)
	      (EQUAL (CAR MEM) '(MOVEI 7 0))
	      (EQUAL (CADR MEM) '(SKIPNE 6))
	      (EQUAL (CADDR MEM) '(STOP))
	      (EQUAL (CADDDR MEM) '(ADD 7 6))
	      (EQUAL (CADDDDR MEM) '(SUBI 6 1))
	      (EQUAL (CADDDDDR MEM) '(JUMPA 1))
	      (NOT (NUMBERP (CADDDDDDR MEM))))
	 (EQUAL
	  (EXECUTE1 1 MEM MAX)
	  (LIST F
	   (CONS
		'(MOVEI 7 0)
		(CONS '(SKIPNE 6)
		      (CONS '(STOP)
			    (CONS '(ADD 7 6)
				  (CONS '(SUBI 6 1)
					(CONS '(JUMPA 1)
					      (CDDDDDDR MEM)))))))))).

  Appealing to the lemma CAR-CDR-ELIM, we now replace MEM by
  (CONS X Z) to eliminate (CAR MEM) and (CDR MEM), Z by (CONS V W) to
  eliminate (CAR Z) and (CDR Z), W by (CONS Z D) to eliminate (CAR W)
  and (CDR W), D by (CONS W C) to eliminate (CAR D) and (CDR D), C by
  (CONS D X1) to eliminate (CAR C) and (CDR C), X1 by (CONS C Z1) to
  eliminate (CAR X1) and (CDR X1), and Z1 by (CONS X1 V1) to
  eliminate (CAR Z1) and (CDR Z1).  This generates eight new
  conjectures:

  Case 3.8.
          (IMPLIES
	   (AND (NOT (LISTP MEM))
		( LEQ 6 MAX)
		(EQUAL (CAR MEM) '(MOVEI 7 0))
		(EQUAL (CADR MEM) '(SKIPNE 6))
		(EQUAL (CADDR MEM) '(STOP))
		(EQUAL (CADDDR MEM) '(ADD 7 6))
		(EQUAL (CADDDDR MEM) '(SUBI 6 1))
		(EQUAL (CADDDDDR MEM) '(JUMPA 1))
		(NOT (NUMBERP (CADDDDDDR MEM))))
	   (EQUAL
	    (EXECUTE1 1 MEM MAX)
	    (LIST F
	     (CONS
		'(MOVEI 7 0)
		(CONS '(SKIPNE 6)
		      (CONS '(STOP)
			    (CONS '(ADD 7 6)
				  (CONS '(SUBI 6 1)
					(CONS '(JUMPA 1)
					      (CDDDDDDR MEM)))))))))).

    However this simplifies further, applying the lemma CAR-NLISTP,
    and expanding the definition of EQUAL, to:

          T.

  Case 3.7.
          (IMPLIES
	   (AND (NOT (LISTP Z))
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL (CAR Z) '(SKIPNE 6))
		(EQUAL (CADR Z) '(STOP))
		(EQUAL (CADDR Z) '(ADD 7 6))
		(EQUAL (CADDDR Z) '(SUBI 6 1))
		(EQUAL (CADDDDR Z) '(JUMPA 1))
		(NOT (NUMBERP (CADDDDDR Z))))
	   (EQUAL
	    (EXECUTE1 1 (CONS X Z) MAX)
	    (LIST F
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
	       '(SKIPNE 6)
	       (CONS
		    '(STOP)
		    (CONS '(ADD 7 6)
			  (CONS '(SUBI 6 1)
				(CONS '(JUMPA 1) (CDDDDDR Z)))))))))),

    which further simplifies, rewriting with CAR-NLISTP, and opening
    up EQUAL, to:

          T.

  Case 3.6.
          (IMPLIES
	   (AND (NOT (LISTP W))
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL (CAR W) '(STOP))
		(EQUAL (CADR W) '(ADD 7 6))
		(EQUAL (CADDR W) '(SUBI 6 1))
		(EQUAL (CADDDR W) '(JUMPA 1))
		(NOT (NUMBERP (CADDDDR W))))
	   (EQUAL
	    (EXECUTE1 1 (CONS X (CONS V W)) MAX)
	    (LIST F
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
	       '(SKIPNE 6)
	       (CONS '(STOP)
		     (CONS '(ADD 7 6)
			   (CONS '(SUBI 6 1)
				 (CONS '(JUMPA 1) (CDDDDR W)))))))))),

    which further simplifies, appealing to the lemma CAR-NLISTP, and
    unfolding the definition of EQUAL, to:

          T.

  Case 3.5.
          (IMPLIES
	   (AND (NOT (LISTP D))
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL (CAR D) '(ADD 7 6))
		(EQUAL (CADR D) '(SUBI 6 1))
		(EQUAL (CADDR D) '(JUMPA 1))
		(NOT (NUMBERP (CADDDR D))))
	   (EQUAL
	    (EXECUTE1 1
		      (CONS X (CONS V (CONS Z D)))
		      MAX)
	    (LIST F
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
		'(SKIPNE 6)
		(CONS '(STOP)
		      (CONS '(ADD 7 6)
			    (CONS '(SUBI 6 1)
				  (CONS '(JUMPA 1) (CDDDR D)))))))))),

    which we further simplify, rewriting with CAR-NLISTP, and opening
    up EQUAL, to:

          T.

  Case 3.4.
          (IMPLIES
	   (AND (NOT (LISTP C))
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL W '(ADD 7 6))
		(EQUAL (CAR C) '(SUBI 6 1))
		(EQUAL (CADR C) '(JUMPA 1))
		(NOT (NUMBERP (CADDR C))))
	   (EQUAL
	    (EXECUTE1 1
		      (CONS X (CONS V (CONS Z (CONS W C))))
		      MAX)
	    (LIST F
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
		 '(SKIPNE 6)
		 (CONS '(STOP)
		       (CONS '(ADD 7 6)
			     (CONS '(SUBI 6 1)
				   (CONS '(JUMPA 1) (CDDR C)))))))))),

    which further simplifies, applying CAR-NLISTP, and expanding the
    function EQUAL, to:

          T.

  Case 3.3.
          (IMPLIES
	   (AND (NOT (LISTP X1))
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL W '(ADD 7 6))
		(EQUAL D '(SUBI 6 1))
		(EQUAL (CAR X1) '(JUMPA 1))
		(NOT (NUMBERP (CADR X1))))
	   (EQUAL
	    (EXECUTE1 1
		      (CONS X
			    (CONS V
				  (CONS Z (CONS W (CONS D X1)))))
		      MAX)
	    (LIST F
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
		 '(SKIPNE 6)
		 (CONS '(STOP)
		       (CONS '(ADD 7 6)
			     (CONS '(SUBI 6 1)
				   (CONS '(JUMPA 1) (CDR X1)))))))))),

    which we further simplify, rewriting with CAR-NLISTP, and
    expanding the definition of EQUAL, to:

          T.

  Case 3.2.
          (IMPLIES
	   (AND (NOT (LISTP Z1))
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL W '(ADD 7 6))
		(EQUAL D '(SUBI 6 1))
		(EQUAL C '(JUMPA 1))
		(NOT (NUMBERP (CAR Z1))))
	   (EQUAL
	    (EXECUTE1 1
		    (CONS X
			  (CONS V
				(CONS Z
				      (CONS W (CONS D (CONS C Z1))))))
		    MAX)
	    (LIST F
	     (CONS
		 '(MOVEI 7 0)
		 (CONS '(SKIPNE 6)
		       (CONS '(STOP)
			     (CONS '(ADD 7 6)
				   (CONS '(SUBI 6 1)
					 (CONS '(JUMPA 1) Z1))))))))),

    which we further simplify, applying CAR-NLISTP, and opening up
    NUMBERP, to:

          T.

  Case 3.1.
          (IMPLIES
	   (AND ( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL W '(ADD 7 6))
		(EQUAL D '(SUBI 6 1))
		(EQUAL C '(JUMPA 1))
		(NOT (NUMBERP X1)))
	   (EQUAL
	    (EXECUTE1 1
	     (CONS X
		  (CONS V
			(CONS Z
			      (CONS W
				    (CONS D (CONS C (CONS X1 V1)))))))
	     MAX)
	    (LIST F
	     (CONS
		  '(MOVEI 7 0)
		  (CONS '(SKIPNE 6)
			(CONS '(STOP)
			      (CONS '(ADD 7 6)
				    (CONS '(SUBI 6 1)
					  (CONS '(JUMPA 1)
						(CONS X1 V1)))))))))).

    But this simplifies further, rewriting with CAR-CONS, CDR-CONS,
    CORRECTNESS-OF-GET-SIMPLIFIER, and EXECUTE1-1, and expanding the
    functions EQUAL and EXECUTE1, to:

          T.

Case 2. (IMPLIES
	 (AND ( LEQ 6 MAX)
	      (EQUAL (CAR MEM) '(MOVEI 7 0))
	      (EQUAL (CADR MEM) '(SKIPNE 6))
	      (EQUAL (CADDR MEM) '(STOP))
	      (EQUAL (CADDDR MEM) '(ADD 7 6))
	      (EQUAL (CADDDDR MEM) '(SUBI 6 1))
	      (EQUAL (CADDDDDR MEM) '(JUMPA 1))
	      (EQUAL (CADDDDDDR MEM) 0))
	 (EQUAL
	  (EXECUTE1 1 MEM MAX)
	  (LIST F
	   (CONS
		'(MOVEI 7 0)
		(CONS '(SKIPNE 6)
		      (CONS '(STOP)
			    (CONS '(ADD 7 6)
				  (CONS '(SUBI 6 1)
					(CONS '(JUMPA 1)
					      (CDDDDDDR MEM)))))))))).

  Appealing to the lemma CAR-CDR-ELIM, we now replace MEM by
  (CONS X Z) to eliminate (CAR MEM) and (CDR MEM), Z by (CONS V W) to
  eliminate (CAR Z) and (CDR Z), W by (CONS Z D) to eliminate (CAR W)
  and (CDR W), D by (CONS W C) to eliminate (CAR D) and (CDR D), C by
  (CONS D X1) to eliminate (CAR C) and (CDR C), X1 by (CONS C Z1) to
  eliminate (CAR X1) and (CDR X1), and Z1 by (CONS X1 V1) to
  eliminate (CAR Z1) and (CDR Z1).  This produces eight new formulas:

  Case 2.8.
          (IMPLIES
	   (AND (NOT (LISTP MEM))
		( LEQ 6 MAX)
		(EQUAL (CAR MEM) '(MOVEI 7 0))
		(EQUAL (CADR MEM) '(SKIPNE 6))
		(EQUAL (CADDR MEM) '(STOP))
		(EQUAL (CADDDR MEM) '(ADD 7 6))
		(EQUAL (CADDDDR MEM) '(SUBI 6 1))
		(EQUAL (CADDDDDR MEM) '(JUMPA 1))
		(EQUAL (CADDDDDDR MEM) 0))
	   (EQUAL
	    (EXECUTE1 1 MEM MAX)
	    (LIST F
	     (CONS
		'(MOVEI 7 0)
		(CONS '(SKIPNE 6)
		      (CONS '(STOP)
			    (CONS '(ADD 7 6)
				  (CONS '(SUBI 6 1)
					(CONS '(JUMPA 1)
					      (CDDDDDDR MEM)))))))))),

    which we further simplify, rewriting with the lemma CAR-NLISTP,
    and expanding the definition of EQUAL, to:

          T.

  Case 2.7.
          (IMPLIES
	   (AND (NOT (LISTP Z))
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL (CAR Z) '(SKIPNE 6))
		(EQUAL (CADR Z) '(STOP))
		(EQUAL (CADDR Z) '(ADD 7 6))
		(EQUAL (CADDDR Z) '(SUBI 6 1))
		(EQUAL (CADDDDR Z) '(JUMPA 1))
		(EQUAL (CADDDDDR Z) 0))
	   (EQUAL
	    (EXECUTE1 1 (CONS X Z) MAX)
	    (LIST F
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
	       '(SKIPNE 6)
	       (CONS
		    '(STOP)
		    (CONS '(ADD 7 6)
			  (CONS '(SUBI 6 1)
				(CONS '(JUMPA 1) (CDDDDDR Z)))))))))).

    This further simplifies, rewriting with the lemma CAR-NLISTP, and
    expanding the function EQUAL, to:

          T.

  Case 2.6.
          (IMPLIES
	   (AND (NOT (LISTP W))
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL (CAR W) '(STOP))
		(EQUAL (CADR W) '(ADD 7 6))
		(EQUAL (CADDR W) '(SUBI 6 1))
		(EQUAL (CADDDR W) '(JUMPA 1))
		(EQUAL (CADDDDR W) 0))
	   (EQUAL
	    (EXECUTE1 1 (CONS X (CONS V W)) MAX)
	    (LIST F
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
	       '(SKIPNE 6)
	       (CONS '(STOP)
		     (CONS '(ADD 7 6)
			   (CONS '(SUBI 6 1)
				 (CONS '(JUMPA 1) (CDDDDR W)))))))))).

    This simplifies further, applying CAR-NLISTP, and expanding the
    function EQUAL, to:

          T.

  Case 2.5.
          (IMPLIES
	   (AND (NOT (LISTP D))
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL (CAR D) '(ADD 7 6))
		(EQUAL (CADR D) '(SUBI 6 1))
		(EQUAL (CADDR D) '(JUMPA 1))
		(EQUAL (CADDDR D) 0))
	   (EQUAL
	    (EXECUTE1 1
		      (CONS X (CONS V (CONS Z D)))
		      MAX)
	    (LIST F
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
		'(SKIPNE 6)
		(CONS '(STOP)
		      (CONS '(ADD 7 6)
			    (CONS '(SUBI 6 1)
				  (CONS '(JUMPA 1) (CDDDR D)))))))))),

    which we further simplify, applying the lemma CAR-NLISTP, and
    opening up the definition of EQUAL, to:

          T.

  Case 2.4.
          (IMPLIES
	   (AND (NOT (LISTP C))
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL W '(ADD 7 6))
		(EQUAL (CAR C) '(SUBI 6 1))
		(EQUAL (CADR C) '(JUMPA 1))
		(EQUAL (CADDR C) 0))
	   (EQUAL
	    (EXECUTE1 1
		      (CONS X (CONS V (CONS Z (CONS W C))))
		      MAX)
	    (LIST F
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
		 '(SKIPNE 6)
		 (CONS '(STOP)
		       (CONS '(ADD 7 6)
			     (CONS '(SUBI 6 1)
				   (CONS '(JUMPA 1) (CDDR C)))))))))),

    which we further simplify, appealing to the lemma CAR-NLISTP, and
    unfolding the function EQUAL, to:

          T.

  Case 2.3.
          (IMPLIES
	   (AND (NOT (LISTP X1))
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL W '(ADD 7 6))
		(EQUAL D '(SUBI 6 1))
		(EQUAL (CAR X1) '(JUMPA 1))
		(EQUAL (CADR X1) 0))
	   (EQUAL
	    (EXECUTE1 1
		      (CONS X
			    (CONS V
				  (CONS Z (CONS W (CONS D X1)))))
		      MAX)
	    (LIST F
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
		 '(SKIPNE 6)
		 (CONS '(STOP)
		       (CONS '(ADD 7 6)
			     (CONS '(SUBI 6 1)
				   (CONS '(JUMPA 1) (CDR X1)))))))))).

    But this further simplifies, rewriting with the lemma CAR-NLISTP,
    and expanding the definition of EQUAL, to:

          T.

  Case 2.2.
          (IMPLIES
	   (AND (NOT (LISTP Z1))
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL W '(ADD 7 6))
		(EQUAL D '(SUBI 6 1))
		(EQUAL C '(JUMPA 1))
		(EQUAL (CAR Z1) 0))
	   (EQUAL
	    (EXECUTE1 1
		    (CONS X
			  (CONS V
				(CONS Z
				      (CONS W (CONS D (CONS C Z1))))))
		    MAX)
	    (LIST F
	     (CONS
		 '(MOVEI 7 0)
		 (CONS '(SKIPNE 6)
		       (CONS '(STOP)
			     (CONS '(ADD 7 6)
				   (CONS '(SUBI 6 1)
					 (CONS '(JUMPA 1) Z1))))))))).

    This further simplifies, rewriting with the lemmas CAR-NLISTP,
    CAR-CONS, CDR-CONS, CORRECTNESS-OF-GET-SIMPLIFIER, and EXECUTE1-1,
    and expanding the functions EQUAL and EXECUTE1, to:

          T.

  Case 2.1.
          (IMPLIES
	   (AND ( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL W '(ADD 7 6))
		(EQUAL D '(SUBI 6 1))
		(EQUAL C '(JUMPA 1))
		(EQUAL X1 0))
	   (EQUAL
	    (EXECUTE1 1
	     (CONS X
		  (CONS V
			(CONS Z
			      (CONS W
				    (CONS D (CONS C (CONS X1 V1)))))))
	     MAX)
	    (LIST F
	     (CONS
		  '(MOVEI 7 0)
		  (CONS '(SKIPNE 6)
			(CONS '(STOP)
			      (CONS '(ADD 7 6)
				    (CONS '(SUBI 6 1)
					  (CONS '(JUMPA 1)
						(CONS X1 V1)))))))))),

    which we further simplify, applying the lemmas CAR-CONS, CDR-CONS,
    CORRECTNESS-OF-GET-SIMPLIFIER, and EXECUTE1-1, and expanding the
    functions EQUAL and EXECUTE1, to:

          T.

Case 1. (IMPLIES
	 (AND ( LEQ 6 MAX)
	      (EQUAL (CAR MEM) '(MOVEI 7 0))
	      (EQUAL (CADR MEM) '(SKIPNE 6))
	      (EQUAL (CADDR MEM) '(STOP))
	      (EQUAL (CADDDR MEM) '(ADD 7 6))
	      (EQUAL (CADDDDR MEM) '(SUBI 6 1))
	      (EQUAL (CADDDDDR MEM) '(JUMPA 1))
	      (NOT (EQUAL (CADDDDDDR MEM) 0))
	      (NUMBERP (CADDDDDDR MEM)))
	 (EQUAL
	  (EXECUTE1 1 MEM MAX)
	  (LIST 1
	   (CONS
	    '(MOVEI 7 0)
	    (CONS
	     '(SKIPNE 6)
	     (CONS
	      '(STOP)
	      (CONS
	       '(ADD 7 6)
	       (CONS
		'(SUBI 6 1)
		(CONS '(JUMPA 1)
		      (CONS (SUB1 (CADDDDDDR MEM))
			    (CONS (ADD1 (PLUS (CADDDDDDDR MEM)
					      (SUB1 (CADDDDDDR MEM))))
				  (CDDDDDDDDR MEM)))))))))))).

  Applying the lemmas SUB1-ELIM and CAR-CDR-ELIM, replace MEM by
  (CONS X Z) to eliminate (CAR MEM) and (CDR MEM), Z by (CONS V W) to
  eliminate (CAR Z) and (CDR Z), W by (CONS Z D) to eliminate (CAR W)
  and (CDR W), D by (CONS W C) to eliminate (CAR D) and (CDR D), C by
  (CONS D X1) to eliminate (CAR C) and (CDR C), X1 by (CONS C Z1) to
  eliminate (CAR X1) and (CDR X1), Z1 by (CONS X1 V1) to eliminate
  (CAR Z1) and (CDR Z1), X1 by (ADD1 Z1) to eliminate (SUB1 X1), and
  V1 by (CONS W1 X1) to eliminate (CDR V1) and (CAR V1).  We employ
  the type restriction lemma noted when SUB1 was introduced to
  restrict the new variables.  We would thus like to prove nine new
  formulas:

  Case 1.9.
          (IMPLIES
	   (AND (NOT (LISTP MEM))
		( LEQ 6 MAX)
		(EQUAL (CAR MEM) '(MOVEI 7 0))
		(EQUAL (CADR MEM) '(SKIPNE 6))
		(EQUAL (CADDR MEM) '(STOP))
		(EQUAL (CADDDR MEM) '(ADD 7 6))
		(EQUAL (CADDDDR MEM) '(SUBI 6 1))
		(EQUAL (CADDDDDR MEM) '(JUMPA 1))
		(NOT (EQUAL (CADDDDDDR MEM) 0))
		(NUMBERP (CADDDDDDR MEM)))
	   (EQUAL
	    (EXECUTE1 1 MEM MAX)
	    (LIST 1
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
	       '(SKIPNE 6)
	       (CONS
		'(STOP)
		(CONS
		 '(ADD 7 6)
		 (CONS
		  '(SUBI 6 1)
		  (CONS
		      '(JUMPA 1)
		      (CONS (SUB1 (CADDDDDDR MEM))
			    (CONS (ADD1 (PLUS (CADDDDDDDR MEM)
					      (SUB1 (CADDDDDDR MEM))))
				  (CDDDDDDDDR MEM)))))))))))).

    But this further simplifies, rewriting with CAR-NLISTP, and
    expanding the function EQUAL, to:

          T.

  Case 1.8.
          (IMPLIES
	   (AND (NOT (LISTP Z))
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL (CAR Z) '(SKIPNE 6))
		(EQUAL (CADR Z) '(STOP))
		(EQUAL (CADDR Z) '(ADD 7 6))
		(EQUAL (CADDDR Z) '(SUBI 6 1))
		(EQUAL (CADDDDR Z) '(JUMPA 1))
		(NOT (EQUAL (CADDDDDR Z) 0))
		(NUMBERP (CADDDDDR Z)))
	   (EQUAL
	    (EXECUTE1 1 (CONS X Z) MAX)
	    (LIST 1
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
	       '(SKIPNE 6)
	       (CONS
		'(STOP)
		(CONS
		 '(ADD 7 6)
		 (CONS
		   '(SUBI 6 1)
		   (CONS '(JUMPA 1)
			 (CONS (SUB1 (CADDDDDR Z))
			       (CONS (ADD1 (PLUS (CADDDDDDR Z)
						 (SUB1 (CADDDDDR Z))))
				     (CDDDDDDDR Z)))))))))))).

    However this simplifies further, rewriting with the lemma
    CAR-NLISTP, and unfolding the function EQUAL, to:

          T.

  Case 1.7.
          (IMPLIES
	   (AND (NOT (LISTP W))
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL (CAR W) '(STOP))
		(EQUAL (CADR W) '(ADD 7 6))
		(EQUAL (CADDR W) '(SUBI 6 1))
		(EQUAL (CADDDR W) '(JUMPA 1))
		(NOT (EQUAL (CADDDDR W) 0))
		(NUMBERP (CADDDDR W)))
	   (EQUAL
	    (EXECUTE1 1 (CONS X (CONS V W)) MAX)
	    (LIST 1
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
	       '(SKIPNE 6)
	       (CONS
		'(STOP)
		(CONS
		 '(ADD 7 6)
		 (CONS
		    '(SUBI 6 1)
		    (CONS '(JUMPA 1)
			  (CONS (SUB1 (CADDDDR W))
				(CONS (ADD1 (PLUS (CADDDDDR W)
						  (SUB1 (CADDDDR W))))
				      (CDDDDDDR W)))))))))))),

    which further simplifies, rewriting with CAR-NLISTP, and
    expanding EQUAL, to:

          T.

  Case 1.6.
          (IMPLIES
	   (AND (NOT (LISTP D))
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL (CAR D) '(ADD 7 6))
		(EQUAL (CADR D) '(SUBI 6 1))
		(EQUAL (CADDR D) '(JUMPA 1))
		(NOT (EQUAL (CADDDR D) 0))
		(NUMBERP (CADDDR D)))
	   (EQUAL
	    (EXECUTE1 1
		      (CONS X (CONS V (CONS Z D)))
		      MAX)
	    (LIST 1
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
	       '(SKIPNE 6)
	       (CONS
		'(STOP)
		(CONS
		 '(ADD 7 6)
		 (CONS
		  '(SUBI 6 1)
		  (CONS
		   '(JUMPA 1)
		   (CONS
		     (SUB1 (CADDDR D))
		     (CONS (ADD1 (PLUS (CADDDDR D) (SUB1 (CADDDR D))))
			   (CDDDDDR D)))))))))))).

    But this further simplifies, rewriting with CAR-NLISTP, and
    expanding the definition of EQUAL, to:

          T.

  Case 1.5.
          (IMPLIES
	   (AND (NOT (LISTP C))
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL W '(ADD 7 6))
		(EQUAL (CAR C) '(SUBI 6 1))
		(EQUAL (CADR C) '(JUMPA 1))
		(NOT (EQUAL (CADDR C) 0))
		(NUMBERP (CADDR C)))
	   (EQUAL
	    (EXECUTE1 1
		      (CONS X (CONS V (CONS Z (CONS W C))))
		      MAX)
	    (LIST 1
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
	       '(SKIPNE 6)
	       (CONS
		'(STOP)
		(CONS
		 '(ADD 7 6)
		 (CONS
		  '(SUBI 6 1)
		  (CONS
		   '(JUMPA 1)
		   (CONS
		       (SUB1 (CADDR C))
		       (CONS (ADD1 (PLUS (CADDDR C) (SUB1 (CADDR C))))
			     (CDDDDR C)))))))))))),

    which we further simplify, rewriting with CAR-NLISTP, and
    unfolding the definition of EQUAL, to:

          T.

  Case 1.4.
          (IMPLIES
	   (AND (NOT (LISTP X1))
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL W '(ADD 7 6))
		(EQUAL D '(SUBI 6 1))
		(EQUAL (CAR X1) '(JUMPA 1))
		(NOT (EQUAL (CADR X1) 0))
		(NUMBERP (CADR X1)))
	   (EQUAL
	    (EXECUTE1 1
		      (CONS X
			    (CONS V
				  (CONS Z (CONS W (CONS D X1)))))
		      MAX)
	    (LIST 1
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
	       '(SKIPNE 6)
	       (CONS
		'(STOP)
		(CONS
		 '(ADD 7 6)
		 (CONS
		  '(SUBI 6 1)
		  (CONS
		   '(JUMPA 1)
		   (CONS
		       (SUB1 (CADR X1))
		       (CONS (ADD1 (PLUS (CADDR X1) (SUB1 (CADR X1))))
			     (CDDDR X1)))))))))))),

    which further simplifies, rewriting with CAR-NLISTP, and opening
    up EQUAL, to:

          T.

  Case 1.3.
          (IMPLIES
	   (AND (NOT (LISTP Z1))
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL W '(ADD 7 6))
		(EQUAL D '(SUBI 6 1))
		(EQUAL C '(JUMPA 1))
		(NOT (EQUAL (CAR Z1) 0))
		(NUMBERP (CAR Z1)))
	   (EQUAL
	    (EXECUTE1 1
		    (CONS X
			  (CONS V
				(CONS Z
				      (CONS W (CONS D (CONS C Z1))))))
		    MAX)
	    (LIST 1
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
	       '(SKIPNE 6)
	       (CONS
		'(STOP)
		(CONS
		 '(ADD 7 6)
		 (CONS
		  '(SUBI 6 1)
		  (CONS
		   '(JUMPA 1)
		   (CONS (SUB1 (CAR Z1))
			 (CONS (ADD1 (PLUS (CADR Z1) (SUB1 (CAR Z1))))
			       (CDDR Z1)))))))))))),

    which further simplifies, rewriting with CAR-NLISTP, and
    expanding EQUAL, to:

          T.

  Case 1.2.
          (IMPLIES
	   (AND (NOT (LISTP V1))
		(NUMBERP Z1)
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL W '(ADD 7 6))
		(EQUAL D '(SUBI 6 1))
		(EQUAL C '(JUMPA 1))
		(NOT (EQUAL (ADD1 Z1) 0)))
	   (EQUAL
	    (EXECUTE1 1
	     (CONS X
	      (CONS V
		   (CONS Z
			 (CONS W
			       (CONS D
				     (CONS C (CONS (ADD1 Z1) V1)))))))
	     MAX)
	    (LIST 1
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
	       '(SKIPNE 6)
	       (CONS
		'(STOP)
		(CONS
		     '(ADD 7 6)
		     (CONS '(SUBI 6 1)
			   (CONS '(JUMPA 1)
				 (CONS Z1
				       (CONS (ADD1 (PLUS (CAR V1) Z1))
					     (CDR V1)))))))))))),

    which we further simplify, applying CAR-CONS, CDR-CONS,
    CAR-NLISTP, PLUS-ADD1, COMMUTATIVITY-OF-PLUS, CDR-NLISTP,
    SUB1-ADD1, DIFFERENCE-1, CORRECTNESS-OF-GET-SIMPLIFIER,
    EXECUTE1-4, EXECUTE1-3, and EXECUTE1-1, and expanding the
    functions EQUAL, PLUS, CDR, CAR, and EXECUTE1, to:

          (IMPLIES
	   (AND (NOT (LISTP V1))
		(NUMBERP Z1)
		( LEQ 6 MAX)
		( LEQ MAX 5))
	   (EQUAL
	    (LIST F
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
	       '(SKIPNE 6)
	       (CONS
		'(STOP)
		(CONS '(ADD 7 6)
		      (CONS '(SUBI 6 1)
			    (CONS '(JUMPA 1)
				  (CONS Z1 (CONS (ADD1 Z1) 0)))))))))
	    (LIST 1
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
	       '(SKIPNE 6)
	       (CONS
		'(STOP)
		(CONS '(ADD 7 6)
		      (CONS '(SUBI 6 1)
			    (CONS '(JUMPA 1)
				  (CONS Z1
					(CONS (ADD1 Z1) 0))))))))))).

    But this again simplifies, using linear arithmetic, to:

          T.

  Case 1.1.
          (IMPLIES
	   (AND (NUMBERP Z1)
		( LEQ 6 MAX)
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL W '(ADD 7 6))
		(EQUAL D '(SUBI 6 1))
		(EQUAL C '(JUMPA 1))
		(NOT (EQUAL (ADD1 Z1) 0)))
	   (EQUAL
	    (EXECUTE1 1
	     (CONS X
	      (CONS V
	       (CONS Z
		 (CONS W
		       (CONS D
			     (CONS C
				   (CONS (ADD1 Z1) (CONS W1 X1))))))))
	     MAX)
	    (LIST 1
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
	       '(SKIPNE 6)
	       (CONS '(STOP)
		     (CONS '(ADD 7 6)
			   (CONS '(SUBI 6 1)
				 (CONS '(JUMPA 1)
				       (CONS Z1
					     (CONS (ADD1 (PLUS W1 Z1))
						   X1))))))))))).

    However this simplifies further, applying CAR-CONS, CDR-CONS,
    PLUS-ADD1, COMMUTATIVITY-OF-PLUS, SUB1-ADD1, DIFFERENCE-1,
    CORRECTNESS-OF-GET-SIMPLIFIER, EXECUTE1-4, EXECUTE1-3, and
    EXECUTE1-1, and unfolding the definitions of CDR, CAR, EQUAL, and
    EXECUTE1, to the new goal:

          (IMPLIES
	   (AND (NUMBERP Z1)
		( LEQ 6 MAX)
		( LEQ MAX 5))
	   (EQUAL
	    (LIST F
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
	       '(SKIPNE 6)
	       (CONS
		'(STOP)
		(CONS
		 '(ADD 7 6)
		 (CONS
		     '(SUBI 6 1)
		     (CONS '(JUMPA 1)
			   (CONS Z1
				 (CONS (ADD1 (PLUS W1 Z1)) X1)))))))))
	    (LIST 1
	     (CONS
	      '(MOVEI 7 0)
	      (CONS
	       '(SKIPNE 6)
	       (CONS '(STOP)
		     (CONS '(ADD 7 6)
			   (CONS '(SUBI 6 1)
				 (CONS '(JUMPA 1)
				       (CONS Z1
					     (CONS (ADD1 (PLUS W1 Z1))
						   X1))))))))))),

    which again simplifies, using linear arithmetic, to:

          T.

Q.E.D.


[ 16.6129558 2.60405272 ]

EXECUTE1-OPENED-UP 


(PROVE-LEMMA EXECUTE-OPENED-UP
	(REWRITE)
	(IMPLIES (AND (NUMBERP PC) (NOT (ZEROP CLK)))
		 (EQUAL (EXECUTE PC MEM CLK)
			(EXECUTE (CAR (EXECUTE1 PC MEM (LENGTH MEM)))
				 (CADR (EXECUTE1 PC MEM (LENGTH MEM)))
				 (SUB1 CLK))))
	NIL)
This formula can be simplified, using the abbreviations ZEROP, NOT,
AND, and IMPLIES, to:

      (IMPLIES (AND (NUMBERP PC)
		    (NOT (EQUAL CLK 0))
		    (NUMBERP CLK))
	       (EQUAL (EXECUTE PC MEM CLK)
		      (EXECUTE (CAR (EXECUTE1 PC MEM (LENGTH MEM)))
			       (CADR (EXECUTE1 PC MEM (LENGTH MEM)))
			       (SUB1 CLK)))).

This simplifies, opening up the function EXECUTE, to:

      T.

Q.E.D.


[ 6.5580241 0.0490071615 ]

EXECUTE-OPENED-UP 


(PROVE-LEMMA INTERPRETER-LOOP-INVRT
	     (REWRITE)
	     (IMPLIES (AND ( LEQ (CADDDDDDR MEM) CLK)
			   (EQUAL (CAR MEM) '(MOVEI 7. 0.))
			   (EQUAL (CADR MEM) '(SKIPNE 6.))
			   (EQUAL (CADDR MEM) '(STOP))
			   (EQUAL (CADDDR MEM) '(ADD 7. 6.))
			   (EQUAL (CADDDDR MEM) '(SUBI 6. 1.))
			   (EQUAL (CADDDDDR MEM) '(JUMPA 1.)))
		      (EQUAL (CADDDDDDDR (EXECUTE 1. MEM CLK))
			     (IF (ZEROP (CADDDDDDR MEM))
				 (CADDDDDDDR MEM)
				 (PLUS (CADDDDDDDR MEM)
				       (SIGMA 0. (CADDDDDDR MEM))))))
	     NIL)
This formula simplifies, unfolding ZEROP, to the following three new
conjectures:

Case 3. (IMPLIES (AND ( LEQ (CADDDDDDR MEM) CLK)
		      (EQUAL (CAR MEM) '(MOVEI 7 0))
		      (EQUAL (CADR MEM) '(SKIPNE 6))
		      (EQUAL (CADDR MEM) '(STOP))
		      (EQUAL (CADDDR MEM) '(ADD 7 6))
		      (EQUAL (CADDDDR MEM) '(SUBI 6 1))
		      (EQUAL (CADDDDDR MEM) '(JUMPA 1))
		      (NOT (NUMBERP (CADDDDDDR MEM))))
		 (EQUAL (CADDDDDDDR (EXECUTE 1 MEM CLK))
			(CADDDDDDDR MEM))),

  which again simplifies, unfolding the function LESSP, to the new
  formula:

        (IMPLIES (AND (EQUAL (CAR MEM) '(MOVEI 7 0))
		      (EQUAL (CADR MEM) '(SKIPNE 6))
		      (EQUAL (CADDR MEM) '(STOP))
		      (EQUAL (CADDDR MEM) '(ADD 7 6))
		      (EQUAL (CADDDDR MEM) '(SUBI 6 1))
		      (EQUAL (CADDDDDR MEM) '(JUMPA 1))
		      (NOT (NUMBERP (CADDDDDDR MEM))))
		 (EQUAL (CADDDDDDDR (EXECUTE 1 MEM CLK))
			(CADDDDDDDR MEM))).

  Appealing to the lemma CAR-CDR-ELIM, we now replace MEM by
  (CONS X Z) to eliminate (CAR MEM) and (CDR MEM), Z by (CONS V W) to
  eliminate (CAR Z) and (CDR Z), W by (CONS Z D) to eliminate (CAR W)
  and (CDR W), D by (CONS W C) to eliminate (CAR D) and (CDR D), C by
  (CONS D X1) to eliminate (CAR C) and (CDR C), X1 by (CONS C Z1) to
  eliminate (CAR X1) and (CDR X1), Z1 by (CONS X1 V1) to eliminate
  (CAR Z1) and (CDR Z1), and V1 by (CONS Z1 W1) to eliminate (CAR V1)
  and (CDR V1).  This generates nine new conjectures:

  Case 3.9.
          (IMPLIES (AND (NOT (LISTP MEM))
			(EQUAL (CAR MEM) '(MOVEI 7 0))
			(EQUAL (CADR MEM) '(SKIPNE 6))
			(EQUAL (CADDR MEM) '(STOP))
			(EQUAL (CADDDR MEM) '(ADD 7 6))
			(EQUAL (CADDDDR MEM) '(SUBI 6 1))
			(EQUAL (CADDDDDR MEM) '(JUMPA 1))
			(NOT (NUMBERP (CADDDDDDR MEM))))
		   (EQUAL (CADDDDDDDR (EXECUTE 1 MEM CLK))
			  (CADDDDDDDR MEM))),

    which we further simplify, rewriting with CAR-NLISTP, and
    unfolding the function EQUAL, to:

          T.

  Case 3.8.
          (IMPLIES (AND (NOT (LISTP Z))
			(EQUAL X '(MOVEI 7 0))
			(EQUAL (CAR Z) '(SKIPNE 6))
			(EQUAL (CADR Z) '(STOP))
			(EQUAL (CADDR Z) '(ADD 7 6))
			(EQUAL (CADDDR Z) '(SUBI 6 1))
			(EQUAL (CADDDDR Z) '(JUMPA 1))
			(NOT (NUMBERP (CADDDDDR Z))))
		   (EQUAL (CADDDDDDDR (EXECUTE 1 (CONS X Z) CLK))
			  (CADDDDDDR Z))).

    However this further simplifies, appealing to the lemma
    CAR-NLISTP, and unfolding the definition of EQUAL, to:

          T.

  Case 3.7.
          (IMPLIES
	      (AND (NOT (LISTP W))
		   (EQUAL X '(MOVEI 7 0))
		   (EQUAL V '(SKIPNE 6))
		   (EQUAL (CAR W) '(STOP))
		   (EQUAL (CADR W) '(ADD 7 6))
		   (EQUAL (CADDR W) '(SUBI 6 1))
		   (EQUAL (CADDDR W) '(JUMPA 1))
		   (NOT (NUMBERP (CADDDDR W))))
	      (EQUAL (CADDDDDDDR (EXECUTE 1 (CONS X (CONS V W)) CLK))
		     (CADDDDDR W))),

    which we further simplify, rewriting with CAR-NLISTP, and opening
    up EQUAL, to:

          T.

  Case 3.6.
          (IMPLIES
	      (AND (NOT (LISTP D))
		   (EQUAL X '(MOVEI 7 0))
		   (EQUAL V '(SKIPNE 6))
		   (EQUAL Z '(STOP))
		   (EQUAL (CAR D) '(ADD 7 6))
		   (EQUAL (CADR D) '(SUBI 6 1))
		   (EQUAL (CADDR D) '(JUMPA 1))
		   (NOT (NUMBERP (CADDDR D))))
	      (EQUAL (CADDDDDDDR (EXECUTE 1
					  (CONS X (CONS V (CONS Z D)))
					  CLK))
		     (CADDDDR D))),

    which further simplifies, applying CAR-NLISTP, and expanding the
    function EQUAL, to:

          T.

  Case 3.5.
          (IMPLIES
	   (AND (NOT (LISTP C))
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL W '(ADD 7 6))
		(EQUAL (CAR C) '(SUBI 6 1))
		(EQUAL (CADR C) '(JUMPA 1))
		(NOT (NUMBERP (CADDR C))))
	   (EQUAL
	    (CADDDDDDDR (EXECUTE 1
				 (CONS X (CONS V (CONS Z (CONS W C))))
				 CLK))
	    (CADDDR C))),

    which we further simplify, rewriting with CAR-NLISTP, and
    expanding the definition of EQUAL, to:

          T.

  Case 3.4.
          (IMPLIES
	   (AND (NOT (LISTP X1))
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL W '(ADD 7 6))
		(EQUAL D '(SUBI 6 1))
		(EQUAL (CAR X1) '(JUMPA 1))
		(NOT (NUMBERP (CADR X1))))
	   (EQUAL
	    (CADDDDDDDR
		  (EXECUTE 1
			   (CONS X
				 (CONS V
				       (CONS Z (CONS W (CONS D X1)))))
			   CLK))
	    (CADDR X1))),

    which we further simplify, applying CAR-NLISTP, and opening up
    EQUAL, to:

          T.

  Case 3.3.
          (IMPLIES
	   (AND (NOT (LISTP Z1))
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL W '(ADD 7 6))
		(EQUAL D '(SUBI 6 1))
		(EQUAL C '(JUMPA 1))
		(NOT (NUMBERP (CAR Z1))))
	   (EQUAL
	    (CADDDDDDDR
	     (EXECUTE 1
		    (CONS X
			  (CONS V
				(CONS Z
				      (CONS W (CONS D (CONS C Z1))))))
		    CLK))
	    (CADR Z1))).

    But this simplifies further, rewriting with CAR-NLISTP, and
    expanding the function NUMBERP, to:

          T.

  Case 3.2.
          (IMPLIES
	   (AND (NOT (LISTP V1))
		(EQUAL X '(MOVEI 7 0))
		(EQUAL V '(SKIPNE 6))
		(EQUAL Z '(STOP))
		(EQUAL W '(ADD 7 6))
		(EQUAL D '(SUBI 6 1))
		(EQUAL C '(JUMPA 1))
		(NOT (NUMBERP X1)))
	   (EQUAL
	    (CADDDDDDDR
	     (EXECUTE 1
	      (CONS X
		  (CONS V
			(CONS Z
			      (CONS W
				    (CONS D (CONS C (CONS X1 V1)))))))
	      CLK))
	    (CAR V1))).

    However this simplifies further, rewriting with the lemma
    CAR-NLISTP, to:

          (IMPLIES
	   (AND (NOT (LISTP V1))
		(NOT (NUMBERP X1)))
	   (EQUAL
	    (CADDDDDDDR
	     (EXECUTE 1
	      (CONS
	       '(MOVEI 7 0)
	       (CONS
		 '(SKIPNE 6)
		 (CONS '(STOP)
		       (CONS '(ADD 7 6)
			     (CONS '(SUBI 6 1)
				   (CONS '(JUMPA 1) (CONS X1 V1)))))))
	      CLK))
	    0)),

    which we would normally push and work on later by induction.  But
    if we must use induction to prove the input conjecture, we prefer
    to induct on the original formulation of the problem.  Thus we
    will disregard all that we have previously done, give the name *1
    to the original input, and work on it.


     So now let us return to:

(IMPLIES (AND ( LEQ (CADDDDDDR MEM) CLK)
	      (EQUAL (CAR MEM) '(MOVEI 7 0))
	      (EQUAL (CADR MEM) '(SKIPNE 6))
	      (EQUAL (CADDR MEM) '(STOP))
	      (EQUAL (CADDDR MEM) '(ADD 7 6))
	      (EQUAL (CADDDDR MEM) '(SUBI 6 1))
	      (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	 (EQUAL (CADDDDDDDR (EXECUTE 1 MEM CLK))
		(IF (ZEROP (CADDDDDDR MEM))
		    (CADDDDDDDR MEM)
		    (PLUS (CADDDDDDDR MEM)
			  (SIGMA 0 (CADDDDDDR MEM)))))).

We named this *1.  Let us appeal to the induction principle.  There
are two plausible inductions.  However, they merge into one likely
candidate induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (OR (EQUAL (CADDDDDDR MEM) 0)
			(NOT (NUMBERP (CADDDDDDR MEM))))
		    (P MEM CLK))
	   (IMPLIES (AND (NOT (OR (EQUAL (CADDDDDDR MEM) 0)
				  (NOT (NUMBERP (CADDDDDDR MEM)))))
			 (OR (EQUAL CLK 0)
			     (NOT (NUMBERP CLK))))
		    (P MEM CLK))
	   (IMPLIES (AND (NOT (OR (EQUAL (CADDDDDDR MEM) 0)
				  (NOT (NUMBERP (CADDDDDDR MEM)))))
			 (NOT (OR (EQUAL CLK 0)
				  (NOT (NUMBERP CLK))))
			 (P (CADR (EXECUTE1 1 MEM (LENGTH MEM)))
			    (SUB1 CLK)))
		    (P MEM CLK))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the
definitions of OR and NOT establish that the measure (COUNT CLK)
decreases according to the well-founded relation LESSP in each
induction step of the scheme.  Note, however, the inductive instance
chosen for MEM.  The above induction scheme produces ten new formulas:

Case 10.(IMPLIES (AND (OR (EQUAL (CADDDDDDR MEM) 0)
			  (NOT (NUMBERP (CADDDDDDR MEM))))
		      ( LEQ (CADDDDDDR MEM) CLK)
		      (EQUAL (CAR MEM) '(MOVEI 7 0))
		      (EQUAL (CADR MEM) '(SKIPNE 6))
		      (EQUAL (CADDR MEM) '(STOP))
		      (EQUAL (CADDDR MEM) '(ADD 7 6))
		      (EQUAL (CADDDDR MEM) '(SUBI 6 1))
		      (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
		 (EQUAL (CADDDDDDDR (EXECUTE 1 MEM CLK))
			(IF (ZEROP (CADDDDDDR MEM))
			    (CADDDDDDDR MEM)
			    (PLUS (CADDDDDDDR MEM)
				  (SIGMA 0 (CADDDDDDR MEM)))))),

  which we simplify, applying the lemma LENGTH-5, and opening up the
  definitions of NOT, OR, EQUAL, LESSP, EXECUTE, NUMBERP, LENGTH, and
  ZEROP, to six new goals:

  Case 10.6.
          (IMPLIES
	       (AND (EQUAL (CADDDDDDR MEM) 0)
		    (EQUAL (CAR MEM) '(MOVEI 7 0))
		    (EQUAL (CADR MEM) '(SKIPNE 6))
		    (EQUAL (CADDR MEM) '(STOP))
		    (EQUAL (CADDDR MEM) '(ADD 7 6))
		    (EQUAL (CADDDDR MEM) '(SUBI 6 1))
		    (EQUAL (CADDDDDR MEM) '(JUMPA 1))
		    (NOT (EQUAL CLK 0))
		    (NUMBERP CLK)
		    (NOT (LISTP MEM)))
	       (EQUAL (CADDDDDDDR (EXECUTE (CAR (EXECUTE1 1 MEM 0))
					   (CADR (EXECUTE1 1 MEM 0))
					   (SUB1 CLK)))
		      (CADDDDDDDR MEM))),

    which we again simplify, applying the lemmas CDR-NLISTP and
    CAR-NLISTP, and opening up the definitions of CDR, CAR, and EQUAL,
    to:

          T.

  Case 10.5.
          (IMPLIES
	   (AND (EQUAL (CADDDDDDR MEM) 0)
		(EQUAL (CAR MEM) '(MOVEI 7 0))
		(EQUAL (CADR MEM) '(SKIPNE 6))
		(EQUAL (CADDR MEM) '(STOP))
		(EQUAL (CADDDR MEM) '(ADD 7 6))
		(EQUAL (CADDDDR MEM) '(SUBI 6 1))
		(EQUAL (CADDDDDR MEM) '(JUMPA 1))
		(NOT (EQUAL CLK 0))
		(NUMBERP CLK)
		(LISTP MEM)
		(LISTP (CDDDDDDR MEM)))
	   (EQUAL
	    (CADDDDDDDR
	     (EXECUTE
	      (CAR
	       (EXECUTE1 1
		       MEM
		       (ADD1 (PLUS 5
				   (ADD1 (LENGTH (CDDDDDDDR MEM)))))))
	      (CADR
	       (EXECUTE1 1
		       MEM
		       (ADD1 (PLUS 5
				   (ADD1 (LENGTH (CDDDDDDDR MEM)))))))
	      (SUB1 CLK)))
	    (CADDDDDDDR MEM))),

    which we again simplify, using linear arithmetic, appealing to
    the lemmas PLUS-ADD1, EXECUTE1-OPENED-UP, CAR-CONS, and CDR-CONS,
    and unfolding the functions EQUAL, NUMBERP, and EXECUTE, to:

          T.

  Case 10.4.
          (IMPLIES
	   (AND (EQUAL (CADDDDDDR MEM) 0)
		(EQUAL (CAR MEM) '(MOVEI 7 0))
		(EQUAL (CADR MEM) '(SKIPNE 6))
		(EQUAL (CADDR MEM) '(STOP))
		(EQUAL (CADDDR MEM) '(ADD 7 6))
		(EQUAL (CADDDDR MEM) '(SUBI 6 1))
		(EQUAL (CADDDDDR MEM) '(JUMPA 1))
		(NOT (EQUAL CLK 0))
		(NUMBERP CLK)
		(LISTP MEM)
		(NOT (LISTP (CDDDDDDR MEM))))
	   (EQUAL
	    (CADDDDDDDR
		 (EXECUTE (CAR (EXECUTE1 1 MEM (ADD1 (PLUS 5 0))))
			  (CADR (EXECUTE1 1 MEM (ADD1 (PLUS 5 0))))
			  (SUB1 CLK)))
	    (CADDDDDDDR MEM))).

    But this again simplifies, rewriting with the lemmas CAR-NLISTP,
    EXECUTE1-OPENED-UP, CAR-CONS, CDR-CONS, and CDR-NLISTP, and
    expanding the definitions of EQUAL, PLUS, ADD1, LESSP, NUMBERP,
    EXECUTE, and CAR, to:

          T.

  Case 10.3.
          (IMPLIES
	       (AND (NOT (NUMBERP (CADDDDDDR MEM)))
		    (EQUAL (CAR MEM) '(MOVEI 7 0))
		    (EQUAL (CADR MEM) '(SKIPNE 6))
		    (EQUAL (CADDR MEM) '(STOP))
		    (EQUAL (CADDDR MEM) '(ADD 7 6))
		    (EQUAL (CADDDDR MEM) '(SUBI 6 1))
		    (EQUAL (CADDDDDR MEM) '(JUMPA 1))
		    (NOT (EQUAL CLK 0))
		    (NUMBERP CLK)
		    (NOT (LISTP MEM)))
	       (EQUAL (CADDDDDDDR (EXECUTE (CAR (EXECUTE1 1 MEM 0))
					   (CADR (EXECUTE1 1 MEM 0))
					   (SUB1 CLK)))
		      (CADDDDDDDR MEM))).

    This again simplifies, rewriting with the lemma CDR-NLISTP, and
    expanding the functions CDR, CAR, and NUMBERP, to:

          T.

  Case 10.2.
          (IMPLIES
	   (AND (NOT (NUMBERP (CADDDDDDR MEM)))
		(EQUAL (CAR MEM) '(MOVEI 7 0))
		(EQUAL (CADR MEM) '(SKIPNE 6))
		(EQUAL (CADDR MEM) '(STOP))
		(EQUAL (CADDDR MEM) '(ADD 7 6))
		(EQUAL (CADDDDR MEM) '(SUBI 6 1))
		(EQUAL (CADDDDDR MEM) '(JUMPA 1))
		(NOT (EQUAL CLK 0))
		(NUMBERP CLK)
		(LISTP MEM)
		(LISTP (CDDDDDDR MEM)))
	   (EQUAL
	    (CADDDDDDDR
	     (EXECUTE
	      (CAR
	       (EXECUTE1 1
		       MEM
		       (ADD1 (PLUS 5
				   (ADD1 (LENGTH (CDDDDDDDR MEM)))))))
	      (CADR
	       (EXECUTE1 1
		       MEM
		       (ADD1 (PLUS 5
				   (ADD1 (LENGTH (CDDDDDDDR MEM)))))))
	      (SUB1 CLK)))
	    (CADDDDDDDR MEM))),

    which we again simplify, using linear arithmetic, applying the
    lemmas PLUS-ADD1, EXECUTE1-OPENED-UP, CAR-CONS, and CDR-CONS, and
    expanding the functions NUMBERP and EXECUTE, to:

          T.

  Case 10.1.
          (IMPLIES
	   (AND (NOT (NUMBERP (CADDDDDDR MEM)))
		(EQUAL (CAR MEM) '(MOVEI 7 0))
		(EQUAL (CADR MEM) '(SKIPNE 6))
		(EQUAL (CADDR MEM) '(STOP))
		(EQUAL (CADDDR MEM) '(ADD 7 6))
		(EQUAL (CADDDDR MEM) '(SUBI 6 1))
		(EQUAL (CADDDDDR MEM) '(JUMPA 1))
		(NOT (EQUAL CLK 0))
		(NUMBERP CLK)
		(LISTP MEM)
		(NOT (LISTP (CDDDDDDR MEM))))
	   (EQUAL
	    (CADDDDDDDR
		 (EXECUTE (CAR (EXECUTE1 1 MEM (ADD1 (PLUS 5 0))))
			  (CADR (EXECUTE1 1 MEM (ADD1 (PLUS 5 0))))
			  (SUB1 CLK)))
	    (CADDDDDDDR MEM))),

    which again simplifies, rewriting with CAR-NLISTP, and expanding
    the definition of NUMBERP, to:

          T.

Case 9. (IMPLIES (AND (NOT (OR (EQUAL (CADDDDDDR MEM) 0)
			       (NOT (NUMBERP (CADDDDDDR MEM)))))
		      (OR (EQUAL CLK 0)
			  (NOT (NUMBERP CLK)))
		      ( LEQ (CADDDDDDR MEM) CLK)
		      (EQUAL (CAR MEM) '(MOVEI 7 0))
		      (EQUAL (CADR MEM) '(SKIPNE 6))
		      (EQUAL (CADDR MEM) '(STOP))
		      (EQUAL (CADDDR MEM) '(ADD 7 6))
		      (EQUAL (CADDDDR MEM) '(SUBI 6 1))
		      (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
		 (EQUAL (CADDDDDDDR (EXECUTE 1 MEM CLK))
			(IF (ZEROP (CADDDDDDR MEM))
			    (CADDDDDDDR MEM)
			    (PLUS (CADDDDDDDR MEM)
				  (SIGMA 0 (CADDDDDDR MEM)))))),

  which simplifies, expanding the functions NOT, OR, EQUAL, and LESSP,
  to:

        T.

Case 8. (IMPLIES
	     (AND (NOT (OR (EQUAL (CADDDDDDR MEM) 0)
			   (NOT (NUMBERP (CADDDDDDR MEM)))))
		  (NOT (OR (EQUAL CLK 0)
			   (NOT (NUMBERP CLK))))
		  (LESSP (SUB1 CLK)
			 (CADDDDDDADR (EXECUTE1 1 MEM (LENGTH MEM))))
		  ( LEQ (CADDDDDDR MEM) CLK)
		  (EQUAL (CAR MEM) '(MOVEI 7 0))
		  (EQUAL (CADR MEM) '(SKIPNE 6))
		  (EQUAL (CADDR MEM) '(STOP))
		  (EQUAL (CADDDR MEM) '(ADD 7 6))
		  (EQUAL (CADDDDR MEM) '(SUBI 6 1))
		  (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	     (EQUAL (CADDDDDDDR (EXECUTE 1 MEM CLK))
		    (IF (ZEROP (CADDDDDDR MEM))
			(CADDDDDDDR MEM)
			(PLUS (CADDDDDDDR MEM)
			      (SIGMA 0 (CADDDDDDR MEM)))))).

  This simplifies, applying LENGTH-5 and EXECUTE-OPENED-UP, and
  opening up NOT, OR, LESSP, LENGTH, and ZEROP, to three new
  conjectures:

  Case 8.3.
          (IMPLIES
	     (AND (NOT (EQUAL (CADDDDDDR MEM) 0))
		  (NUMBERP (CADDDDDDR MEM))
		  (NOT (EQUAL CLK 0))
		  (NUMBERP CLK)
		  (LESSP (SUB1 CLK)
			 (CADDDDDDADR (EXECUTE1 1 MEM (LENGTH MEM))))
		  ( LEQ
		    (SUB1 (CADDDDDDR MEM))
		    (SUB1 CLK))
		  (EQUAL (CAR MEM) '(MOVEI 7 0))
		  (EQUAL (CADR MEM) '(SKIPNE 6))
		  (EQUAL (CADDR MEM) '(STOP))
		  (EQUAL (CADDDR MEM) '(ADD 7 6))
		  (EQUAL (CADDDDR MEM) '(SUBI 6 1))
		  (EQUAL (CADDDDDR MEM) '(JUMPA 1))
		  (NOT (LISTP MEM)))
	     (EQUAL (CADDDDDDDR (EXECUTE (CAR (EXECUTE1 1 MEM 0))
					 (CADR (EXECUTE1 1 MEM 0))
					 (SUB1 CLK)))
		    (PLUS (CADDDDDDDR MEM)
			  (SIGMA 0 (CADDDDDDR MEM))))).

    However this again simplifies, appealing to the lemma CDR-NLISTP,
    and opening up CDR, CAR, and EQUAL, to:

          T.

  Case 8.2.
          (IMPLIES
	   (AND (NOT (EQUAL (CADDDDDDR MEM) 0))
		(NUMBERP (CADDDDDDR MEM))
		(NOT (EQUAL CLK 0))
		(NUMBERP CLK)
		(LESSP (SUB1 CLK)
		       (CADDDDDDADR (EXECUTE1 1 MEM (LENGTH MEM))))
		( LEQ
		  (SUB1 (CADDDDDDR MEM))
		  (SUB1 CLK))
		(EQUAL (CAR MEM) '(MOVEI 7 0))
		(EQUAL (CADR MEM) '(SKIPNE 6))
		(EQUAL (CADDR MEM) '(STOP))
		(EQUAL (CADDDR MEM) '(ADD 7 6))
		(EQUAL (CADDDDR MEM) '(SUBI 6 1))
		(EQUAL (CADDDDDR MEM) '(JUMPA 1))
		(LISTP MEM)
		(LISTP (CDDDDDDR MEM)))
	   (EQUAL
	    (CADDDDDDDR
	     (EXECUTE
	      (CAR
	       (EXECUTE1 1
		       MEM
		       (ADD1 (PLUS 5
				   (ADD1 (LENGTH (CDDDDDDDR MEM)))))))
	      (CADR
	       (EXECUTE1 1
		       MEM
		       (ADD1 (PLUS 5
				   (ADD1 (LENGTH (CDDDDDDDR MEM)))))))
	      (SUB1 CLK)))
	    (PLUS (CADDDDDDDR MEM)
		  (SIGMA 0 (CADDDDDDR MEM))))).

    However this again simplifies, using linear arithmetic and
    applying the lemmas PLUS-ADD1, EXECUTE1-OPENED-UP, CAR-CONS, and
    CDR-CONS, to:

          (IMPLIES
	   (AND (NOT (EQUAL (CADDDDDDR MEM) 0))
		(NUMBERP (CADDDDDDR MEM))
		(NOT (EQUAL CLK 0))
		(NUMBERP CLK)
		(LESSP (SUB1 CLK)
		       (CADDDDDDADR (EXECUTE1 1 MEM (LENGTH MEM))))
		( LEQ
		  (SUB1 (CADDDDDDR MEM))
		  (SUB1 CLK))
		(EQUAL (CAR MEM) '(MOVEI 7 0))
		(EQUAL (CADR MEM) '(SKIPNE 6))
		(EQUAL (CADDR MEM) '(STOP))
		(EQUAL (CADDDR MEM) '(ADD 7 6))
		(EQUAL (CADDDDR MEM) '(SUBI 6 1))
		(EQUAL (CADDDDDR MEM) '(JUMPA 1))
		(LISTP MEM)
		(LISTP (CDDDDDDR MEM)))
	   (EQUAL
	    (CADDDDDDDR
	     (EXECUTE 1
	      (CONS
	       '(MOVEI 7 0)
	       (CONS
		'(SKIPNE 6)
		(CONS
		 '(STOP)
		 (CONS
		      '(ADD 7 6)
		      (CONS '(SUBI 6 1)
			    (CONS '(JUMPA 1)
				  (CONS (SUB1 (CADDDDDDR MEM))
					(CONS (PLUS (CADDDDDDR MEM)
						    (CADDDDDDDR MEM))
					      (CDDDDDDDDR MEM)))))))))
	      (SUB1 CLK)))
	    (PLUS (CADDDDDDDR MEM)
		  (SIGMA 0 (CADDDDDDR MEM))))).

    This simplifies further, using linear arithmetic, rewriting with
    the lemmas PLUS-ADD1, LENGTH-5, EXECUTE1-OPENED-UP, CDR-CONS, and
    CAR-CONS, and unfolding the definition of LENGTH, to:

          T.

  Case 8.1.
          (IMPLIES
	   (AND (NOT (EQUAL (CADDDDDDR MEM) 0))
		(NUMBERP (CADDDDDDR MEM))
		(NOT (EQUAL CLK 0))
		(NUMBERP CLK)
		(LESSP (SUB1 CLK)
		       (CADDDDDDADR (EXECUTE1 1 MEM (LENGTH MEM))))
		( LEQ
		  (SUB1 (CADDDDDDR MEM))
		  (SUB1 CLK))
		(EQUAL (CAR MEM) '(MOVEI 7 0))
		(EQUAL (CADR MEM) '(SKIPNE 6))
		(EQUAL (CADDR MEM) '(STOP))
		(EQUAL (CADDDR MEM) '(ADD 7 6))
		(EQUAL (CADDDDR MEM) '(SUBI 6 1))
		(EQUAL (CADDDDDR MEM) '(JUMPA 1))
		(LISTP MEM)
		(NOT (LISTP (CDDDDDDR MEM))))
	   (EQUAL
	    (CADDDDDDDR
		 (EXECUTE (CAR (EXECUTE1 1 MEM (ADD1 (PLUS 5 0))))
			  (CADR (EXECUTE1 1 MEM (ADD1 (PLUS 5 0))))
			  (SUB1 CLK)))
	    (PLUS (CADDDDDDDR MEM)
		  (SIGMA 0 (CADDDDDDR MEM))))),

    which again simplifies, rewriting with CAR-NLISTP, and opening up
    EQUAL, to:

          T.

Case 7. (IMPLIES
	       (AND (NOT (OR (EQUAL (CADDDDDDR MEM) 0)
			     (NOT (NUMBERP (CADDDDDDR MEM)))))
		    (NOT (OR (EQUAL CLK 0)
			     (NOT (NUMBERP CLK))))
		    (NOT (EQUAL (CAADR (EXECUTE1 1 MEM (LENGTH MEM)))
				'(MOVEI 7 0)))
		    ( LEQ (CADDDDDDR MEM) CLK)
		    (EQUAL (CAR MEM) '(MOVEI 7 0))
		    (EQUAL (CADR MEM) '(SKIPNE 6))
		    (EQUAL (CADDR MEM) '(STOP))
		    (EQUAL (CADDDR MEM) '(ADD 7 6))
		    (EQUAL (CADDDDR MEM) '(SUBI 6 1))
		    (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	       (EQUAL (CADDDDDDDR (EXECUTE 1 MEM CLK))
		      (IF (ZEROP (CADDDDDDR MEM))
			  (CADDDDDDDR MEM)
			  (PLUS (CADDDDDDDR MEM)
				(SIGMA 0 (CADDDDDDR MEM)))))),

  which simplifies, using linear arithmetic, rewriting with LENGTH-5,
  CDR-NLISTP, CAR-NLISTP, PLUS-ADD1, EXECUTE1-OPENED-UP, CAR-CONS,
  CDR-CONS, and EXECUTE-OPENED-UP, and expanding NOT, OR, LENGTH, CDR,
  CAR, EQUAL, LESSP, ZEROP, PLUS, ADD1, NUMBERP, and EXECUTE, to:

        (IMPLIES
	 (AND
	  (NOT (EQUAL (CADDDDDDR MEM) 0))
	  (NUMBERP (CADDDDDDR MEM))
	  (NOT (EQUAL CLK 0))
	  (NUMBERP CLK)
	  (LISTP MEM)
	  (LISTP (CDDDDDDR MEM))
	  (NOT
	   (EQUAL
	    (CAADR
	     (EXECUTE1 1
		       MEM
		       (ADD1 (PLUS 5
				   (ADD1 (LENGTH (CDDDDDDDR MEM)))))))
	    '(MOVEI 7 0)))
	  ( LEQ
	    (SUB1 (CADDDDDDR MEM))
	    (SUB1 CLK))
	  (EQUAL (CAR MEM) '(MOVEI 7 0))
	  (EQUAL (CADR MEM) '(SKIPNE 6))
	  (EQUAL (CADDR MEM) '(STOP))
	  (EQUAL (CADDDR MEM) '(ADD 7 6))
	  (EQUAL (CADDDDR MEM) '(SUBI 6 1))
	  (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	 (EQUAL
	  (CADDDDDDDR
	   (EXECUTE 1
	    (CONS
	     '(MOVEI 7 0)
	     (CONS
	      '(SKIPNE 6)
	      (CONS
		'(STOP)
		(CONS '(ADD 7 6)
		      (CONS '(SUBI 6 1)
			    (CONS '(JUMPA 1)
				  (CONS (SUB1 (CADDDDDDR MEM))
					(CONS (PLUS (CADDDDDDR MEM)
						    (CADDDDDDDR MEM))
					      (CDDDDDDDDR MEM)))))))))
	    (SUB1 CLK)))
	  (PLUS (CADDDDDDDR MEM)
		(SIGMA 0 (CADDDDDDR MEM))))),

  which we again simplify, using linear arithmetic, applying
  PLUS-ADD1, EXECUTE1-OPENED-UP, CDR-CONS, and CAR-CONS, and opening
  up EQUAL, to:

        T.

Case 6. (IMPLIES
	      (AND (NOT (OR (EQUAL (CADDDDDDR MEM) 0)
			    (NOT (NUMBERP (CADDDDDDR MEM)))))
		   (NOT (OR (EQUAL CLK 0)
			    (NOT (NUMBERP CLK))))
		   (NOT (EQUAL (CADADR (EXECUTE1 1 MEM (LENGTH MEM)))
			       '(SKIPNE 6)))
		   ( LEQ (CADDDDDDR MEM) CLK)
		   (EQUAL (CAR MEM) '(MOVEI 7 0))
		   (EQUAL (CADR MEM) '(SKIPNE 6))
		   (EQUAL (CADDR MEM) '(STOP))
		   (EQUAL (CADDDR MEM) '(ADD 7 6))
		   (EQUAL (CADDDDR MEM) '(SUBI 6 1))
		   (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	      (EQUAL (CADDDDDDDR (EXECUTE 1 MEM CLK))
		     (IF (ZEROP (CADDDDDDR MEM))
			 (CADDDDDDDR MEM)
			 (PLUS (CADDDDDDDR MEM)
			       (SIGMA 0 (CADDDDDDR MEM)))))).

  This simplifies, using linear arithmetic, rewriting with LENGTH-5,
  CDR-NLISTP, CAR-NLISTP, PLUS-ADD1, EXECUTE1-OPENED-UP, CAR-CONS,
  CDR-CONS, and EXECUTE-OPENED-UP, and unfolding NOT, OR, LENGTH, CDR,
  CAR, EQUAL, LESSP, ZEROP, PLUS, ADD1, NUMBERP, and EXECUTE, to:

        (IMPLIES
	 (AND
	  (NOT (EQUAL (CADDDDDDR MEM) 0))
	  (NUMBERP (CADDDDDDR MEM))
	  (NOT (EQUAL CLK 0))
	  (NUMBERP CLK)
	  (LISTP MEM)
	  (LISTP (CDDDDDDR MEM))
	  (NOT
	   (EQUAL
	    (CADADR
	     (EXECUTE1 1
		       MEM
		       (ADD1 (PLUS 5
				   (ADD1 (LENGTH (CDDDDDDDR MEM)))))))
	    '(SKIPNE 6)))
	  ( LEQ
	    (SUB1 (CADDDDDDR MEM))
	    (SUB1 CLK))
	  (EQUAL (CAR MEM) '(MOVEI 7 0))
	  (EQUAL (CADR MEM) '(SKIPNE 6))
	  (EQUAL (CADDR MEM) '(STOP))
	  (EQUAL (CADDDR MEM) '(ADD 7 6))
	  (EQUAL (CADDDDR MEM) '(SUBI 6 1))
	  (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	 (EQUAL
	  (CADDDDDDDR
	   (EXECUTE 1
	    (CONS
	     '(MOVEI 7 0)
	     (CONS
	      '(SKIPNE 6)
	      (CONS
		'(STOP)
		(CONS '(ADD 7 6)
		      (CONS '(SUBI 6 1)
			    (CONS '(JUMPA 1)
				  (CONS (SUB1 (CADDDDDDR MEM))
					(CONS (PLUS (CADDDDDDR MEM)
						    (CADDDDDDDR MEM))
					      (CDDDDDDDDR MEM)))))))))
	    (SUB1 CLK)))
	  (PLUS (CADDDDDDDR MEM)
		(SIGMA 0 (CADDDDDDR MEM))))).

  However this again simplifies, using linear arithmetic, appealing
  to the lemmas PLUS-ADD1, EXECUTE1-OPENED-UP, CDR-CONS, and CAR-CONS,
  and opening up the function EQUAL, to:

        T.

Case 5. (IMPLIES
	     (AND (NOT (OR (EQUAL (CADDDDDDR MEM) 0)
			   (NOT (NUMBERP (CADDDDDDR MEM)))))
		  (NOT (OR (EQUAL CLK 0)
			   (NOT (NUMBERP CLK))))
		  (NOT (EQUAL (CADDADR (EXECUTE1 1 MEM (LENGTH MEM)))
			      '(STOP)))
		  ( LEQ (CADDDDDDR MEM) CLK)
		  (EQUAL (CAR MEM) '(MOVEI 7 0))
		  (EQUAL (CADR MEM) '(SKIPNE 6))
		  (EQUAL (CADDR MEM) '(STOP))
		  (EQUAL (CADDDR MEM) '(ADD 7 6))
		  (EQUAL (CADDDDR MEM) '(SUBI 6 1))
		  (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	     (EQUAL (CADDDDDDDR (EXECUTE 1 MEM CLK))
		    (IF (ZEROP (CADDDDDDR MEM))
			(CADDDDDDDR MEM)
			(PLUS (CADDDDDDDR MEM)
			      (SIGMA 0 (CADDDDDDR MEM)))))).

  This simplifies, using linear arithmetic, rewriting with the lemmas
  LENGTH-5, CDR-NLISTP, CAR-NLISTP, PLUS-ADD1, EXECUTE1-OPENED-UP,
  CAR-CONS, CDR-CONS, and EXECUTE-OPENED-UP, and opening up NOT, OR,
  LENGTH, CDR, CAR, EQUAL, LESSP, ZEROP, PLUS, ADD1, NUMBERP, and
  EXECUTE, to:

        (IMPLIES
	 (AND
	  (NOT (EQUAL (CADDDDDDR MEM) 0))
	  (NUMBERP (CADDDDDDR MEM))
	  (NOT (EQUAL CLK 0))
	  (NUMBERP CLK)
	  (LISTP MEM)
	  (LISTP (CDDDDDDR MEM))
	  (NOT
	   (EQUAL
	    (CADDADR
	     (EXECUTE1 1
		       MEM
		       (ADD1 (PLUS 5
				   (ADD1 (LENGTH (CDDDDDDDR MEM)))))))
	    '(STOP)))
	  ( LEQ
	    (SUB1 (CADDDDDDR MEM))
	    (SUB1 CLK))
	  (EQUAL (CAR MEM) '(MOVEI 7 0))
	  (EQUAL (CADR MEM) '(SKIPNE 6))
	  (EQUAL (CADDR MEM) '(STOP))
	  (EQUAL (CADDDR MEM) '(ADD 7 6))
	  (EQUAL (CADDDDR MEM) '(SUBI 6 1))
	  (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	 (EQUAL
	  (CADDDDDDDR
	   (EXECUTE 1
	    (CONS
	     '(MOVEI 7 0)
	     (CONS
	      '(SKIPNE 6)
	      (CONS
		'(STOP)
		(CONS '(ADD 7 6)
		      (CONS '(SUBI 6 1)
			    (CONS '(JUMPA 1)
				  (CONS (SUB1 (CADDDDDDR MEM))
					(CONS (PLUS (CADDDDDDR MEM)
						    (CADDDDDDDR MEM))
					      (CDDDDDDDDR MEM)))))))))
	    (SUB1 CLK)))
	  (PLUS (CADDDDDDDR MEM)
		(SIGMA 0 (CADDDDDDR MEM))))).

  This again simplifies, using linear arithmetic, rewriting with
  PLUS-ADD1, EXECUTE1-OPENED-UP, CDR-CONS, and CAR-CONS, and
  unfolding the function EQUAL, to:

        T.

Case 4. (IMPLIES
	    (AND (NOT (OR (EQUAL (CADDDDDDR MEM) 0)
			  (NOT (NUMBERP (CADDDDDDR MEM)))))
		 (NOT (OR (EQUAL CLK 0)
			  (NOT (NUMBERP CLK))))
		 (NOT (EQUAL (CADDDADR (EXECUTE1 1 MEM (LENGTH MEM)))
			     '(ADD 7 6)))
		 ( LEQ (CADDDDDDR MEM) CLK)
		 (EQUAL (CAR MEM) '(MOVEI 7 0))
		 (EQUAL (CADR MEM) '(SKIPNE 6))
		 (EQUAL (CADDR MEM) '(STOP))
		 (EQUAL (CADDDR MEM) '(ADD 7 6))
		 (EQUAL (CADDDDR MEM) '(SUBI 6 1))
		 (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	    (EQUAL (CADDDDDDDR (EXECUTE 1 MEM CLK))
		   (IF (ZEROP (CADDDDDDR MEM))
		       (CADDDDDDDR MEM)
		       (PLUS (CADDDDDDDR MEM)
			     (SIGMA 0 (CADDDDDDR MEM)))))),

  which simplifies, using linear arithmetic, rewriting with LENGTH-5,
  CDR-NLISTP, CAR-NLISTP, PLUS-ADD1, EXECUTE1-OPENED-UP, CAR-CONS,
  CDR-CONS, and EXECUTE-OPENED-UP, and expanding NOT, OR, LENGTH, CDR,
  CAR, EQUAL, LESSP, ZEROP, PLUS, ADD1, NUMBERP, and EXECUTE, to:

        (IMPLIES
	 (AND
	  (NOT (EQUAL (CADDDDDDR MEM) 0))
	  (NUMBERP (CADDDDDDR MEM))
	  (NOT (EQUAL CLK 0))
	  (NUMBERP CLK)
	  (LISTP MEM)
	  (LISTP (CDDDDDDR MEM))
	  (NOT
	   (EQUAL
	    (CADDDADR
	     (EXECUTE1 1
		       MEM
		       (ADD1 (PLUS 5
				   (ADD1 (LENGTH (CDDDDDDDR MEM)))))))
	    '(ADD 7 6)))
	  ( LEQ
	    (SUB1 (CADDDDDDR MEM))
	    (SUB1 CLK))
	  (EQUAL (CAR MEM) '(MOVEI 7 0))
	  (EQUAL (CADR MEM) '(SKIPNE 6))
	  (EQUAL (CADDR MEM) '(STOP))
	  (EQUAL (CADDDR MEM) '(ADD 7 6))
	  (EQUAL (CADDDDR MEM) '(SUBI 6 1))
	  (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	 (EQUAL
	  (CADDDDDDDR
	   (EXECUTE 1
	    (CONS
	     '(MOVEI 7 0)
	     (CONS
	      '(SKIPNE 6)
	      (CONS
		'(STOP)
		(CONS '(ADD 7 6)
		      (CONS '(SUBI 6 1)
			    (CONS '(JUMPA 1)
				  (CONS (SUB1 (CADDDDDDR MEM))
					(CONS (PLUS (CADDDDDDR MEM)
						    (CADDDDDDDR MEM))
					      (CDDDDDDDDR MEM)))))))))
	    (SUB1 CLK)))
	  (PLUS (CADDDDDDDR MEM)
		(SIGMA 0 (CADDDDDDR MEM))))).

  This again simplifies, using linear arithmetic, appealing to the
  lemmas PLUS-ADD1, EXECUTE1-OPENED-UP, CDR-CONS, and CAR-CONS, and
  unfolding EQUAL, to:

        T.

Case 3. (IMPLIES
	   (AND (NOT (OR (EQUAL (CADDDDDDR MEM) 0)
			 (NOT (NUMBERP (CADDDDDDR MEM)))))
		(NOT (OR (EQUAL CLK 0)
			 (NOT (NUMBERP CLK))))
		(NOT (EQUAL (CADDDDADR (EXECUTE1 1 MEM (LENGTH MEM)))
			    '(SUBI 6 1)))
		( LEQ (CADDDDDDR MEM) CLK)
		(EQUAL (CAR MEM) '(MOVEI 7 0))
		(EQUAL (CADR MEM) '(SKIPNE 6))
		(EQUAL (CADDR MEM) '(STOP))
		(EQUAL (CADDDR MEM) '(ADD 7 6))
		(EQUAL (CADDDDR MEM) '(SUBI 6 1))
		(EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	   (EQUAL (CADDDDDDDR (EXECUTE 1 MEM CLK))
		  (IF (ZEROP (CADDDDDDR MEM))
		      (CADDDDDDDR MEM)
		      (PLUS (CADDDDDDDR MEM)
			    (SIGMA 0 (CADDDDDDR MEM)))))).

  This simplifies, using linear arithmetic, applying LENGTH-5,
  CDR-NLISTP, CAR-NLISTP, PLUS-ADD1, EXECUTE1-OPENED-UP, CAR-CONS,
  CDR-CONS, and EXECUTE-OPENED-UP, and unfolding NOT, OR, LENGTH, CDR,
  CAR, EQUAL, LESSP, ZEROP, PLUS, ADD1, NUMBERP, and EXECUTE, to:

        (IMPLIES
	 (AND
	  (NOT (EQUAL (CADDDDDDR MEM) 0))
	  (NUMBERP (CADDDDDDR MEM))
	  (NOT (EQUAL CLK 0))
	  (NUMBERP CLK)
	  (LISTP MEM)
	  (LISTP (CDDDDDDR MEM))
	  (NOT
	   (EQUAL
	    (CADDDDADR
	     (EXECUTE1 1
		       MEM
		       (ADD1 (PLUS 5
				   (ADD1 (LENGTH (CDDDDDDDR MEM)))))))
	    '(SUBI 6 1)))
	  ( LEQ
	    (SUB1 (CADDDDDDR MEM))
	    (SUB1 CLK))
	  (EQUAL (CAR MEM) '(MOVEI 7 0))
	  (EQUAL (CADR MEM) '(SKIPNE 6))
	  (EQUAL (CADDR MEM) '(STOP))
	  (EQUAL (CADDDR MEM) '(ADD 7 6))
	  (EQUAL (CADDDDR MEM) '(SUBI 6 1))
	  (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	 (EQUAL
	  (CADDDDDDDR
	   (EXECUTE 1
	    (CONS
	     '(MOVEI 7 0)
	     (CONS
	      '(SKIPNE 6)
	      (CONS
		'(STOP)
		(CONS '(ADD 7 6)
		      (CONS '(SUBI 6 1)
			    (CONS '(JUMPA 1)
				  (CONS (SUB1 (CADDDDDDR MEM))
					(CONS (PLUS (CADDDDDDR MEM)
						    (CADDDDDDDR MEM))
					      (CDDDDDDDDR MEM)))))))))
	    (SUB1 CLK)))
	  (PLUS (CADDDDDDDR MEM)
		(SIGMA 0 (CADDDDDDR MEM))))),

  which again simplifies, using linear arithmetic, applying the
  lemmas PLUS-ADD1, EXECUTE1-OPENED-UP, CDR-CONS, and CAR-CONS, and
  expanding the function EQUAL, to:

        T.

Case 2. (IMPLIES
	  (AND (NOT (OR (EQUAL (CADDDDDDR MEM) 0)
			(NOT (NUMBERP (CADDDDDDR MEM)))))
	       (NOT (OR (EQUAL CLK 0)
			(NOT (NUMBERP CLK))))
	       (NOT (EQUAL (CADDDDDADR (EXECUTE1 1 MEM (LENGTH MEM)))
			   '(JUMPA 1)))
	       ( LEQ (CADDDDDDR MEM) CLK)
	       (EQUAL (CAR MEM) '(MOVEI 7 0))
	       (EQUAL (CADR MEM) '(SKIPNE 6))
	       (EQUAL (CADDR MEM) '(STOP))
	       (EQUAL (CADDDR MEM) '(ADD 7 6))
	       (EQUAL (CADDDDR MEM) '(SUBI 6 1))
	       (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	  (EQUAL (CADDDDDDDR (EXECUTE 1 MEM CLK))
		 (IF (ZEROP (CADDDDDDR MEM))
		     (CADDDDDDDR MEM)
		     (PLUS (CADDDDDDDR MEM)
			   (SIGMA 0 (CADDDDDDR MEM)))))),

  which simplifies, using linear arithmetic, rewriting with LENGTH-5,
  CDR-NLISTP, CAR-NLISTP, PLUS-ADD1, EXECUTE1-OPENED-UP, CAR-CONS,
  CDR-CONS, and EXECUTE-OPENED-UP, and expanding the functions NOT,
  OR, LENGTH, CDR, CAR, EQUAL, LESSP, ZEROP, PLUS, ADD1, NUMBERP, and
  EXECUTE, to:

        (IMPLIES
	 (AND
	  (NOT (EQUAL (CADDDDDDR MEM) 0))
	  (NUMBERP (CADDDDDDR MEM))
	  (NOT (EQUAL CLK 0))
	  (NUMBERP CLK)
	  (LISTP MEM)
	  (LISTP (CDDDDDDR MEM))
	  (NOT
	   (EQUAL
	    (CADDDDDADR
	     (EXECUTE1 1
		       MEM
		       (ADD1 (PLUS 5
				   (ADD1 (LENGTH (CDDDDDDDR MEM)))))))
	    '(JUMPA 1)))
	  ( LEQ
	    (SUB1 (CADDDDDDR MEM))
	    (SUB1 CLK))
	  (EQUAL (CAR MEM) '(MOVEI 7 0))
	  (EQUAL (CADR MEM) '(SKIPNE 6))
	  (EQUAL (CADDR MEM) '(STOP))
	  (EQUAL (CADDDR MEM) '(ADD 7 6))
	  (EQUAL (CADDDDR MEM) '(SUBI 6 1))
	  (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	 (EQUAL
	  (CADDDDDDDR
	   (EXECUTE 1
	    (CONS
	     '(MOVEI 7 0)
	     (CONS
	      '(SKIPNE 6)
	      (CONS
		'(STOP)
		(CONS '(ADD 7 6)
		      (CONS '(SUBI 6 1)
			    (CONS '(JUMPA 1)
				  (CONS (SUB1 (CADDDDDDR MEM))
					(CONS (PLUS (CADDDDDDR MEM)
						    (CADDDDDDDR MEM))
					      (CDDDDDDDDR MEM)))))))))
	    (SUB1 CLK)))
	  (PLUS (CADDDDDDDR MEM)
		(SIGMA 0 (CADDDDDDR MEM))))).

  However this again simplifies, using linear arithmetic, rewriting
  with PLUS-ADD1, EXECUTE1-OPENED-UP, CDR-CONS, and CAR-CONS, and
  expanding EQUAL, to:

        T.

Case 1. (IMPLIES
	 (AND
	  (NOT (OR (EQUAL (CADDDDDDR MEM) 0)
		   (NOT (NUMBERP (CADDDDDDR MEM)))))
	  (NOT (OR (EQUAL CLK 0)
		   (NOT (NUMBERP CLK))))
	  (EQUAL
	   (CADDDDDDDR (EXECUTE 1
				(CADR (EXECUTE1 1 MEM (LENGTH MEM)))
				(SUB1 CLK)))
	   (IF
	    (ZEROP (CADDDDDDADR (EXECUTE1 1 MEM (LENGTH MEM))))
	    (CADDDDDDDADR (EXECUTE1 1 MEM (LENGTH MEM)))
	    (PLUS
	       (CADDDDDDDADR (EXECUTE1 1 MEM (LENGTH MEM)))
	       (SIGMA 0
		      (CADDDDDDADR (EXECUTE1 1 MEM (LENGTH MEM)))))))
	  ( LEQ (CADDDDDDR MEM) CLK)
	  (EQUAL (CAR MEM) '(MOVEI 7 0))
	  (EQUAL (CADR MEM) '(SKIPNE 6))
	  (EQUAL (CADDR MEM) '(STOP))
	  (EQUAL (CADDDR MEM) '(ADD 7 6))
	  (EQUAL (CADDDDR MEM) '(SUBI 6 1))
	  (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	 (EQUAL (CADDDDDDDR (EXECUTE 1 MEM CLK))
		(IF (ZEROP (CADDDDDDR MEM))
		    (CADDDDDDDR MEM)
		    (PLUS (CADDDDDDDR MEM)
			  (SIGMA 0 (CADDDDDDR MEM)))))).

  This simplifies, using linear arithmetic, applying the lemmas
  LENGTH-5, CAR-NLISTP, EXECUTE1-OPENED-UP, CAR-CONS, CDR-CONS,
  EXECUTE-OPENED-UP, CDR-NLISTP, and PLUS-ADD1, and opening up the
  definitions of NOT, OR, LENGTH, EQUAL, LESSP, PLUS, ADD1, NUMBERP,
  EXECUTE, CAR, ZEROP, and CDR, to two new conjectures:

  Case 1.2.
          (IMPLIES
	   (AND
	    (NOT (EQUAL (CADDDDDDR MEM) 0))
	    (NUMBERP (CADDDDDDR MEM))
	    (NOT (EQUAL CLK 0))
	    (NUMBERP CLK)
	    (LISTP MEM)
	    (LISTP (CDDDDDDR MEM))
	    (NOT
	     (ZEROP
	      (CADDDDDDADR
	       (EXECUTE1 1
		     MEM
		     (ADD1 (PLUS 5
				 (ADD1 (LENGTH (CDDDDDDDR MEM)))))))))
	    (EQUAL
	     (CADDDDDDDR
			(EXECUTE 1
				 (CADR (EXECUTE1 1 MEM (LENGTH MEM)))
				 (SUB1 CLK)))
	     (PLUS
	      (CADDDDDDDADR
	       (EXECUTE1 1
		       MEM
		       (ADD1 (PLUS 5
				   (ADD1 (LENGTH (CDDDDDDDR MEM)))))))
	      (SIGMA 0
	       (CADDDDDDADR
		(EXECUTE1 1
		    MEM
		    (ADD1 (PLUS 5
				(ADD1 (LENGTH (CDDDDDDDR MEM))))))))))
	    ( LEQ
	      (SUB1 (CADDDDDDR MEM))
	      (SUB1 CLK))
	    (EQUAL (CAR MEM) '(MOVEI 7 0))
	    (EQUAL (CADR MEM) '(SKIPNE 6))
	    (EQUAL (CADDR MEM) '(STOP))
	    (EQUAL (CADDDR MEM) '(ADD 7 6))
	    (EQUAL (CADDDDR MEM) '(SUBI 6 1))
	    (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	   (EQUAL
	    (CADDDDDDDR
	     (EXECUTE 1
	      (CONS
	       '(MOVEI 7 0)
	       (CONS
		'(SKIPNE 6)
		(CONS
		 '(STOP)
		 (CONS
		      '(ADD 7 6)
		      (CONS '(SUBI 6 1)
			    (CONS '(JUMPA 1)
				  (CONS (SUB1 (CADDDDDDR MEM))
					(CONS (PLUS (CADDDDDDR MEM)
						    (CADDDDDDDR MEM))
					      (CDDDDDDDDR MEM)))))))))
	      (SUB1 CLK)))
	    (PLUS (CADDDDDDDR MEM)
		  (SIGMA 0 (CADDDDDDR MEM))))).

    But this again simplifies, using linear arithmetic, rewriting
    with PLUS-ADD1, EXECUTE1-OPENED-UP, CDR-CONS, CAR-CONS, and
    ASSOCIATIVITY-OF-PLUS, and unfolding the definition of ZEROP, to:

          (IMPLIES
	   (AND
	    (NOT (EQUAL (CADDDDDDR MEM) 0))
	    (NUMBERP (CADDDDDDR MEM))
	    (NOT (EQUAL CLK 0))
	    (NUMBERP CLK)
	    (LISTP MEM)
	    (LISTP (CDDDDDDR MEM))
	    (NOT (EQUAL (SUB1 (CADDDDDDR MEM)) 0))
	    (EQUAL
	     (CADDDDDDDR
			(EXECUTE 1
				 (CADR (EXECUTE1 1 MEM (LENGTH MEM)))
				 (SUB1 CLK)))
	     (PLUS (CADDDDDDR MEM)
		   (PLUS (CADDDDDDDR MEM)
			 (SIGMA 0 (SUB1 (CADDDDDDR MEM))))))
	    ( LEQ
	      (SUB1 (CADDDDDDR MEM))
	      (SUB1 CLK))
	    (EQUAL (CAR MEM) '(MOVEI 7 0))
	    (EQUAL (CADR MEM) '(SKIPNE 6))
	    (EQUAL (CADDR MEM) '(STOP))
	    (EQUAL (CADDDR MEM) '(ADD 7 6))
	    (EQUAL (CADDDDR MEM) '(SUBI 6 1))
	    (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	   (EQUAL
	    (CADDDDDDDR
	     (EXECUTE 1
	      (CONS
	       '(MOVEI 7 0)
	       (CONS
		'(SKIPNE 6)
		(CONS
		 '(STOP)
		 (CONS
		      '(ADD 7 6)
		      (CONS '(SUBI 6 1)
			    (CONS '(JUMPA 1)
				  (CONS (SUB1 (CADDDDDDR MEM))
					(CONS (PLUS (CADDDDDDR MEM)
						    (CADDDDDDDR MEM))
					      (CDDDDDDDDR MEM)))))))))
	      (SUB1 CLK)))
	    (PLUS (CADDDDDDDR MEM)
		  (SIGMA 0 (CADDDDDDR MEM))))),

    which again simplifies, using linear arithmetic, rewriting with
    CDR-CONS, PLUS-ADD1, LENGTH-CONS6, CAR-CONS,
    COMMUTATIVITY-OF-PLUS, COMMUTATIVITY2-OF-PLUS, EXECUTE1-OPENED-UP,
    and EXECUTE-OPENED-UP, and unfolding LENGTH, EQUAL, LESSP, and
    SIGMA, to the new goal:

          (IMPLIES
	   (AND
	    (NOT (EQUAL (CADDDDDDR MEM) 0))
	    (NUMBERP (CADDDDDDR MEM))
	    (NOT (EQUAL CLK 0))
	    (NUMBERP CLK)
	    (LISTP MEM)
	    (LISTP (CDDDDDDR MEM))
	    (NOT (EQUAL (SUB1 (CADDDDDDR MEM)) 0))
	    (EQUAL
	     (CADDDDDDDR
			(EXECUTE 1
				 (CADR (EXECUTE1 1 MEM (LENGTH MEM)))
				 (SUB1 CLK)))
	     (PLUS (CADDDDDDR MEM)
		   (PLUS (CADDDDDDDR MEM)
			 (SIGMA 0 (SUB1 (CADDDDDDR MEM))))))
	    ( LEQ
	      (SUB1 (CADDDDDDR MEM))
	      (SUB1 CLK))
	    (EQUAL (CAR MEM) '(MOVEI 7 0))
	    (EQUAL (CADR MEM) '(SKIPNE 6))
	    (EQUAL (CADDR MEM) '(STOP))
	    (EQUAL (CADDDR MEM) '(ADD 7 6))
	    (EQUAL (CADDDDR MEM) '(SUBI 6 1))
	    (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	   (EQUAL
	    (CADDDDDDDR
	     (EXECUTE 1
	      (CONS
	       '(MOVEI 7 0)
	       (CONS
		'(SKIPNE 6)
		(CONS
		 '(STOP)
		 (CONS
		  '(ADD 7 6)
		  (CONS
		   '(SUBI 6 1)
		   (CONS
		      '(JUMPA 1)
		      (CONS (SUB1 (SUB1 (CADDDDDDR MEM)))
			    (CONS (PLUS (CADDDDDDR MEM)
					(PLUS (CADDDDDDDR MEM)
					      (SUB1 (CADDDDDDR MEM))))
				  (CDDDDDDDDR MEM)))))))))
	      (SUB1 (SUB1 CLK))))
	    (CADDDDDDDR (EXECUTE 1
				 (CADR (EXECUTE1 1 MEM (LENGTH MEM)))
				 (SUB1 CLK))))).

    However this further simplifies, using linear arithmetic,
    rewriting with PLUS-ADD1, LENGTH-5, EXECUTE1-OPENED-UP, CDR-CONS,
    CAR-CONS, LENGTH-CONS6, COMMUTATIVITY-OF-PLUS,
    COMMUTATIVITY2-OF-PLUS, and EXECUTE-OPENED-UP, and opening up the
    functions LENGTH and EQUAL, to:

          T.

  Case 1.1.
          (IMPLIES
	   (AND
	    (NOT (EQUAL (CADDDDDDR MEM) 0))
	    (NUMBERP (CADDDDDDR MEM))
	    (NOT (EQUAL CLK 0))
	    (NUMBERP CLK)
	    (LISTP MEM)
	    (LISTP (CDDDDDDR MEM))
	    (ZEROP
	     (CADDDDDDADR
	      (EXECUTE1 1
		      MEM
		      (ADD1 (PLUS 5
				  (ADD1 (LENGTH (CDDDDDDDR MEM))))))))
	    (EQUAL
	     (CADDDDDDDR
			(EXECUTE 1
				 (CADR (EXECUTE1 1 MEM (LENGTH MEM)))
				 (SUB1 CLK)))
	     (CADDDDDDDADR
	      (EXECUTE1 1
		      MEM
		      (ADD1 (PLUS 5
				  (ADD1 (LENGTH (CDDDDDDDR MEM))))))))
	    ( LEQ
	      (SUB1 (CADDDDDDR MEM))
	      (SUB1 CLK))
	    (EQUAL (CAR MEM) '(MOVEI 7 0))
	    (EQUAL (CADR MEM) '(SKIPNE 6))
	    (EQUAL (CADDR MEM) '(STOP))
	    (EQUAL (CADDDR MEM) '(ADD 7 6))
	    (EQUAL (CADDDDR MEM) '(SUBI 6 1))
	    (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	   (EQUAL
	    (CADDDDDDDR
	     (EXECUTE 1
	      (CONS
	       '(MOVEI 7 0)
	       (CONS
		'(SKIPNE 6)
		(CONS
		 '(STOP)
		 (CONS
		      '(ADD 7 6)
		      (CONS '(SUBI 6 1)
			    (CONS '(JUMPA 1)
				  (CONS (SUB1 (CADDDDDDR MEM))
					(CONS (PLUS (CADDDDDDR MEM)
						    (CADDDDDDDR MEM))
					      (CDDDDDDDDR MEM)))))))))
	      (SUB1 CLK)))
	    (PLUS (CADDDDDDDR MEM)
		  (SIGMA 0 (CADDDDDDR MEM))))).

    However this again simplifies, using linear arithmetic, rewriting
    with the lemmas PLUS-ADD1, EXECUTE1-OPENED-UP, CDR-CONS, CAR-CONS,
    PLUS-RIGHT-ID2, and COMMUTATIVITY-OF-PLUS, and expanding the
    definitions of ZEROP, PLUS, EQUAL, LESSP, and SIGMA, to two new
    conjectures:

    Case 1.1.2.
            (IMPLIES
	     (AND
	      (NOT (EQUAL (CADDDDDDR MEM) 0))
	      (NUMBERP (CADDDDDDR MEM))
	      (NOT (EQUAL CLK 0))
	      (NUMBERP CLK)
	      (LISTP MEM)
	      (LISTP (CDDDDDDR MEM))
	      (EQUAL (SUB1 (CADDDDDDR MEM)) 0)
	      (NOT (NUMBERP (CADDDDDDDR MEM)))
	      (EQUAL
	       (CADDDDDDDR
			(EXECUTE 1
				 (CADR (EXECUTE1 1 MEM (LENGTH MEM)))
				 (SUB1 CLK)))
	       1)
	      (EQUAL (CAR MEM) '(MOVEI 7 0))
	      (EQUAL (CADR MEM) '(SKIPNE 6))
	      (EQUAL (CADDR MEM) '(STOP))
	      (EQUAL (CADDDR MEM) '(ADD 7 6))
	      (EQUAL (CADDDDR MEM) '(SUBI 6 1))
	      (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	     (EQUAL
	      (CADDDDDDDR
	       (EXECUTE 1
		(CONS
		 '(MOVEI 7 0)
		 (CONS
		  '(SKIPNE 6)
		  (CONS
		   '(STOP)
		   (CONS
		      '(ADD 7 6)
		      (CONS '(SUBI 6 1)
			    (CONS '(JUMPA 1)
				  (CONS 0
					(CONS (CADDDDDDR MEM)
					      (CDDDDDDDDR MEM)))))))))
		(SUB1 CLK)))
	      (CADDDDDDR MEM))).

      This simplifies further, using linear arithmetic, rewriting
      with PLUS-ADD1, LENGTH-5, PLUS-RIGHT-ID2, EXECUTE1-OPENED-UP,
      CDR-CONS, and CAR-CONS, and unfolding LENGTH, to:

            (IMPLIES
	     (AND
	      (NOT (EQUAL (CADDDDDDR MEM) 0))
	      (NUMBERP (CADDDDDDR MEM))
	      (NOT (EQUAL CLK 0))
	      (NUMBERP CLK)
	      (LISTP MEM)
	      (LISTP (CDDDDDDR MEM))
	      (EQUAL (SUB1 (CADDDDDDR MEM)) 0)
	      (NOT (NUMBERP (CADDDDDDDR MEM)))
	      (EQUAL
	       (CADDDDDDDR
		(EXECUTE 1
		 (CONS
		  '(MOVEI 7 0)
		  (CONS
		   '(SKIPNE 6)
		   (CONS
		    '(STOP)
		    (CONS
		      '(ADD 7 6)
		      (CONS '(SUBI 6 1)
			    (CONS '(JUMPA 1)
				  (CONS 0
					(CONS (CADDDDDDR MEM)
					      (CDDDDDDDDR MEM)))))))))
		 (SUB1 CLK)))
	       1)
	      (EQUAL (CAR MEM) '(MOVEI 7 0))
	      (EQUAL (CADR MEM) '(SKIPNE 6))
	      (EQUAL (CADDR MEM) '(STOP))
	      (EQUAL (CADDDR MEM) '(ADD 7 6))
	      (EQUAL (CADDDDR MEM) '(SUBI 6 1))
	      (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	     (EQUAL 1 (CADDDDDDR MEM))),

      which again simplifies, using linear arithmetic, to:

            T.

    Case 1.1.1.
            (IMPLIES
	     (AND
	      (NOT (EQUAL (CADDDDDDR MEM) 0))
	      (NUMBERP (CADDDDDDR MEM))
	      (NOT (EQUAL CLK 0))
	      (NUMBERP CLK)
	      (LISTP MEM)
	      (LISTP (CDDDDDDR MEM))
	      (EQUAL (SUB1 (CADDDDDDR MEM)) 0)
	      (NUMBERP (CADDDDDDDR MEM))
	      (EQUAL
	       (CADDDDDDDR
			(EXECUTE 1
				 (CADR (EXECUTE1 1 MEM (LENGTH MEM)))
				 (SUB1 CLK)))
	       (ADD1 (CADDDDDDDR MEM)))
	      (EQUAL (CAR MEM) '(MOVEI 7 0))
	      (EQUAL (CADR MEM) '(SKIPNE 6))
	      (EQUAL (CADDR MEM) '(STOP))
	      (EQUAL (CADDDR MEM) '(ADD 7 6))
	      (EQUAL (CADDDDR MEM) '(SUBI 6 1))
	      (EQUAL (CADDDDDR MEM) '(JUMPA 1)))
	     (EQUAL
	      (CADDDDDDDR
	       (EXECUTE 1
		(CONS
		 '(MOVEI 7 0)
		 (CONS
		  '(SKIPNE 6)
		  (CONS
		   '(STOP)
		   (CONS
		      '(ADD 7 6)
		      (CONS '(SUBI 6 1)
			    (CONS '(JUMPA 1)
				  (CONS 0
					(CONS (ADD1 (CADDDDDDDR MEM))
					      (CDDDDDDDDR MEM)))))))))
		(SUB1 CLK)))
	      (ADD1 (CADDDDDDDR MEM)))),

      which we further simplify, using linear arithmetic, rewriting
      with PLUS-ADD1, LENGTH-5, EXECUTE1-OPENED-UP, CDR-CONS, and
      CAR-CONS, and unfolding LENGTH, PLUS, and EQUAL, to:

            T.


     That finishes the proof of *1.  Q.E.D.


[ 216.051985 4.6910156 ]

INTERPRETER-LOOP-INVRT 


(PROVE-LEMMA INTERPRETER-INPUT-PATH
 (REWRITE)
 (EQUAL
  (EXECUTE 0.
	   (CONS '(MOVEI 7. 0.)
		 (CONS '(SKIPNE 6.)
		       (CONS '(STOP)
			     (CONS '(ADD 7. 6.)
				   (CONS '(SUBI 6. 1.)
					 (CONS '(JUMPA 1.) MEM))))))
	   CLK)
  (IF
   (ZEROP CLK)
   (CONS '(MOVEI 7. 0.)
	 (CONS '(SKIPNE 6.)
	       (CONS '(STOP)
		     (CONS '(ADD 7. 6.)
			   (CONS '(SUBI 6. 1.)
				 (CONS '(JUMPA 1.) MEM))))))
   (EXECUTE 1.
    (CONS
       '(MOVEI 7. 0.)
       (CONS '(SKIPNE 6.)
	     (CONS '(STOP)
		   (CONS '(ADD 7. 6.)
			 (CONS '(SUBI 6. 1.)
			       (CONS '(JUMPA 1.)
				     (CONS (CAR MEM)
					   (CONS 0. (CDDR MEM)))))))))
    CLK)))
 NIL)
This simplifies, unfolding the function ZEROP, to three new
conjectures:

Case 3. (IMPLIES
	 (NOT (NUMBERP CLK))
	 (EQUAL
	  (EXECUTE 0
	      (CONS '(MOVEI 7 0)
		    (CONS '(SKIPNE 6)
			  (CONS '(STOP)
				(CONS '(ADD 7 6)
				      (CONS '(SUBI 6 1)
					    (CONS '(JUMPA 1) MEM))))))
	      CLK)
	  (CONS '(MOVEI 7 0)
		(CONS '(SKIPNE 6)
		      (CONS '(STOP)
			    (CONS '(ADD 7 6)
				  (CONS '(SUBI 6 1)
					(CONS '(JUMPA 1) MEM)))))))).

  However this again simplifies, opening up the definition of EXECUTE,
  to:

        T.

Case 2. (IMPLIES
	 (EQUAL CLK 0)
	 (EQUAL
	  (EXECUTE 0
	      (CONS '(MOVEI 7 0)
		    (CONS '(SKIPNE 6)
			  (CONS '(STOP)
				(CONS '(ADD 7 6)
				      (CONS '(SUBI 6 1)
					    (CONS '(JUMPA 1) MEM))))))
	      CLK)
	  (CONS '(MOVEI 7 0)
		(CONS '(SKIPNE 6)
		      (CONS '(STOP)
			    (CONS '(ADD 7 6)
				  (CONS '(SUBI 6 1)
					(CONS '(JUMPA 1) MEM)))))))).

  However this simplifies again, opening up the definitions of EQUAL
  and EXECUTE, to:

        T.

Case 1. (IMPLIES
	 (AND (NOT (EQUAL CLK 0))
	      (NUMBERP CLK))
	 (EQUAL
	  (EXECUTE 0
	      (CONS '(MOVEI 7 0)
		    (CONS '(SKIPNE 6)
			  (CONS '(STOP)
				(CONS '(ADD 7 6)
				      (CONS '(SUBI 6 1)
					    (CONS '(JUMPA 1) MEM))))))
	      CLK)
	  (EXECUTE 1
	   (CONS
	    '(MOVEI 7 0)
	    (CONS
	     '(SKIPNE 6)
	     (CONS '(STOP)
		   (CONS '(ADD 7 6)
			 (CONS '(SUBI 6 1)
			       (CONS '(JUMPA 1)
				     (CONS (CAR MEM)
					   (CONS 0 (CDDR MEM)))))))))
	   CLK))),

  which we again simplify, using linear arithmetic, rewriting with
  the lemmas LENGTH-CONS6, EXECUTE1-OPENED-UP, COMMUTATIVITY-OF-PLUS,
  CDR-CONS, CORRECTNESS-OF-SET-SIMPLIFIER, CAR-CONS,
  CORRECTNESS-OF-GET-SIMPLIFIER, PLUS-EQUAL-0, EXECUTE-OPENED-UP, and
  PLUS-ADD1, and unfolding the functions LENGTH, PLUS, CDR, ADD1, CAR,
  LESSP, EQUAL, NUMBERP, and EXECUTE1, to:

        T.

Q.E.D.


[ 15.3480306 0.21796875 ]

INTERPRETER-INPUT-PATH 


(PROVE-LEMMA CORRECTNESS-OF-INTERPRETED-SIGMA NIL
	     (IMPLIES (AND (EQUAL MEM
				  (APPEND '((MOVEI 7. 0.)
					    (SKIPNE 6.)
					    (STOP)
					    (ADD 7. 6.)
					    (SUBI 6. 1.)
					    (JUMPA 1.))
					  TL))
			   (EQUAL I (GET 6. MEM))
			   ( LEQ I CLK))
		      (EQUAL (GET 7. (EXECUTE 0. MEM CLK))
			     (IF (ZEROP CLK)
				 (GET 7. MEM)
				 (SIGMA 0. I)))))
This formula simplifies, using linear arithmetic, applying
CORRECTNESS-OF-GET-SIMPLIFIER, CDR-CONS, PLUS-ADD1, LENGTH-CONS6,
CAR-CONS, COMMUTATIVITY-OF-PLUS, EXECUTE1-OPENED-UP,
EXECUTE-OPENED-UP, and INTERPRETER-INPUT-PATH, and opening up CDR,
CAR, LISTP, APPEND, LENGTH, EQUAL, PLUS, and ZEROP, to the following
five new goals:

Case 5. (IMPLIES
	 (AND ( LEQ (CAR TL) CLK)
	      (NOT (NUMBERP CLK)))
	 (EQUAL
	  (CADDDDDDDR
	      (CONS '(MOVEI 7 0)
		    (CONS '(SKIPNE 6)
			  (CONS '(STOP)
				(CONS '(ADD 7 6)
				      (CONS '(SUBI 6 1)
					    (CONS '(JUMPA 1) TL)))))))
	  (CADR TL))),

  which we again simplify, applying CDR-CONS, and unfolding the
  function LESSP, to:

        T.

Case 4. (IMPLIES
	 (AND ( LEQ (CAR TL) CLK)
	      (EQUAL CLK 0))
	 (EQUAL
	  (CADDDDDDDR
	      (CONS '(MOVEI 7 0)
		    (CONS '(SKIPNE 6)
			  (CONS '(STOP)
				(CONS '(ADD 7 6)
				      (CONS '(SUBI 6 1)
					    (CONS '(JUMPA 1) TL)))))))
	  (CADR TL))),

  which we again simplify, rewriting with CDR-CONS, and unfolding the
  definitions of EQUAL and LESSP, to:

        T.

Case 3. (IMPLIES
	 (AND ( LEQ (CAR TL) CLK)
	      (NOT (EQUAL CLK 0))
	      (NUMBERP CLK)
	      (NOT (EQUAL (CAR TL) 0))
	      (NUMBERP (CAR TL)))
	 (EQUAL
	  (CADDDDDDDR
	   (EXECUTE
	    (CAR
	     (LIST 1
	      (CONS
	       '(MOVEI 7 0)
	       (CONS
		'(SKIPNE 6)
		(CONS
		 '(STOP)
		 (CONS
		  '(ADD 7 6)
		  (CONS '(SUBI 6 1)
			(CONS '(JUMPA 1)
			      (CONS (SUB1 (CAR TL))
				    (CONS (CAR TL) (CDDR TL)))))))))))
	    (CADR
	     (LIST 1
	      (CONS
	       '(MOVEI 7 0)
	       (CONS
		'(SKIPNE 6)
		(CONS
		 '(STOP)
		 (CONS
		  '(ADD 7 6)
		  (CONS '(SUBI 6 1)
			(CONS '(JUMPA 1)
			      (CONS (SUB1 (CAR TL))
				    (CONS (CAR TL) (CDDR TL)))))))))))
	    (SUB1 CLK)))
	  (SIGMA 0 (CAR TL)))).

  This simplifies again, using linear arithmetic, applying CAR-CONS,
  CDR-CONS, and INTERPRETER-LOOP-INVRT, and opening up EQUAL, to two
  new goals:

  Case 3.2.
          (IMPLIES (AND ( LEQ (CAR TL) CLK)
			(NOT (EQUAL CLK 0))
			(NUMBERP CLK)
			(NOT (EQUAL (CAR TL) 0))
			(NUMBERP (CAR TL))
			(NOT (EQUAL (SUB1 (CAR TL)) 0)))
		   (EQUAL (PLUS (CAR TL)
				(SIGMA 0 (SUB1 (CAR TL))))
			  (SIGMA 0 (CAR TL)))).

    However this again simplifies, opening up the functions LESSP,
    EQUAL, and SIGMA, to:

          T.

  Case 3.1.
          (IMPLIES (AND ( LEQ (CAR TL) CLK)
			(NOT (EQUAL CLK 0))
			(NUMBERP CLK)
			(NOT (EQUAL (CAR TL) 0))
			(NUMBERP (CAR TL))
			(EQUAL (SUB1 (CAR TL)) 0))
		   (EQUAL (CAR TL) (SIGMA 0 (CAR TL)))),

    which again simplifies, rewriting with COMMUTATIVITY-OF-PLUS, and
    expanding LESSP, EQUAL, PLUS, and SIGMA, to:

          T.

Case 2. (IMPLIES
	 (AND ( LEQ (CAR TL) CLK)
	      (NOT (EQUAL CLK 0))
	      (NUMBERP CLK)
	      (NOT (EQUAL (CAR TL) 0))
	      (NOT (NUMBERP (CAR TL))))
	 (EQUAL
	  (CADDDDDDDR
	   (EXECUTE
	    (CAR
	     (LIST F
	      (CONS
	       '(MOVEI 7 0)
	       (CONS
		'(SKIPNE 6)
		(CONS
		  '(STOP)
		  (CONS '(ADD 7 6)
			(CONS '(SUBI 6 1)
			      (CONS '(JUMPA 1)
				    (CONS (CAR TL)
					  (CONS 0 (CDDR TL)))))))))))
	    (CADR
	     (LIST F
	      (CONS
	       '(MOVEI 7 0)
	       (CONS
		'(SKIPNE 6)
		(CONS
		  '(STOP)
		  (CONS '(ADD 7 6)
			(CONS '(SUBI 6 1)
			      (CONS '(JUMPA 1)
				    (CONS (CAR TL)
					  (CONS 0 (CDDR TL)))))))))))
	    (SUB1 CLK)))
	  (SIGMA 0 (CAR TL)))),

  which we again simplify, applying CAR-CONS and CDR-CONS, and
  expanding the definitions of LESSP, NUMBERP, EXECUTE, SIGMA, and
  EQUAL, to:

        T.

Case 1. (IMPLIES
	 (AND ( LEQ (CAR TL) CLK)
	      (NOT (EQUAL CLK 0))
	      (NUMBERP CLK)
	      (EQUAL (CAR TL) 0))
	 (EQUAL
	  (CADDDDDDDR
	   (EXECUTE
	    (CAR
	     (LIST F
	      (CONS
	       '(MOVEI 7 0)
	       (CONS
		'(SKIPNE 6)
		(CONS
		 '(STOP)
		 (CONS
		     '(ADD 7 6)
		     (CONS '(SUBI 6 1)
			   (CONS '(JUMPA 1)
				 (CONS 0 (CONS 0 (CDDR TL)))))))))))
	    (CADR
	     (LIST F
	      (CONS
	       '(MOVEI 7 0)
	       (CONS
		'(SKIPNE 6)
		(CONS
		 '(STOP)
		 (CONS
		     '(ADD 7 6)
		     (CONS '(SUBI 6 1)
			   (CONS '(JUMPA 1)
				 (CONS 0 (CONS 0 (CDDR TL)))))))))))
	    (SUB1 CLK)))
	  (SIGMA 0 (CAR TL)))),

  which we again simplify, rewriting with CAR-CONS and CDR-CONS, and
  unfolding EQUAL, LESSP, NUMBERP, EXECUTE, and SIGMA, to:

        T.

Q.E.D.


[ 37.2450194 0.496972658 ]

CORRECTNESS-OF-INTERPRETED-SIGMA 


(PROVE-LEMMA DIFFERENCE-2
	     (REWRITE)
	     (EQUAL (DIFFERENCE (ADD1 (ADD1 X)) 2.)
		    (FIX X)))
This formula simplifies, applying the lemmas DIFFERENCE-1 and
SUB1-ADD1, and opening up SUB1, NUMBERP, EQUAL, DIFFERENCE, and FIX,
to:

      T.

Q.E.D.


[ 0.166992188 0.0260091147 ]

DIFFERENCE-2 


(PROVE-LEMMA HALF-PLUS
	     (REWRITE)
	     (EQUAL (QUOTIENT (PLUS X (PLUS X Y)) 2.)
		    (PLUS X (QUOTIENT Y 2.))))
.

Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace Y by
(PLUS V (TIMES 2 Z)) to eliminate (QUOTIENT Y 2) and (REMAINDER Y 2).
We rely upon LESSP-REMAINDER2, the type restriction lemma noted when
QUOTIENT was introduced, and the type restriction lemma noted when
REMAINDER was introduced to restrict the new variables.  This
produces the following four new goals:

Case 4. (IMPLIES (NOT (NUMBERP Y))
		 (EQUAL (QUOTIENT (PLUS X (PLUS X Y)) 2)
			(PLUS X (QUOTIENT Y 2)))),

  which simplifies, rewriting with PLUS-RIGHT-ID2 and
  COMMUTATIVITY-OF-PLUS, and expanding the functions LESSP, NUMBERP,
  EQUAL, QUOTIENT, and PLUS, to two new conjectures:

  Case 4.2.
          (IMPLIES (AND (NOT (NUMBERP Y))
			(NOT (NUMBERP X)))
		   (EQUAL (QUOTIENT (PLUS X 0) 2) 0)),

    which we again simplify, rewriting with PLUS-RIGHT-ID2 and
    COMMUTATIVITY-OF-PLUS, and unfolding the functions NUMBERP,
    QUOTIENT, and EQUAL, to:

          T.

  Case 4.1.
          (IMPLIES (AND (NOT (NUMBERP Y)) (NUMBERP X))
		   (EQUAL (QUOTIENT (PLUS X X) 2) X)).

    However this again simplifies, using linear arithmetic, appealing
    to the lemma DIVIDES-IMPLIES-TIMES, and unfolding the definition
    of EQUAL, to:

          T.

Case 3. (IMPLIES (EQUAL 2 0)
		 (EQUAL (QUOTIENT (PLUS X (PLUS X Y)) 2)
			(PLUS X (QUOTIENT Y 2)))),

  which we simplify, using linear arithmetic, to:

        T.

Case 2. (IMPLIES (NOT (NUMBERP 2))
		 (EQUAL (QUOTIENT (PLUS X (PLUS X Y)) 2)
			(PLUS X (QUOTIENT Y 2)))),

  which we simplify, obviously, to:

        T.

Case 1. (IMPLIES
		(AND (NUMBERP Z)
		     (NUMBERP V)
		     (EQUAL (LESSP V 2) (NOT (ZEROP 2)))
		     (NOT (EQUAL 2 0)))
		(EQUAL (QUOTIENT (PLUS X
				       (PLUS X (PLUS V (TIMES 2 Z))))
				 2)
		       (PLUS X Z))),

  which simplifies, applying COMMUTATIVITY2-OF-PLUS, and expanding
  the functions ZEROP, NOT, and EQUAL, to:

        (IMPLIES
		(AND (NUMBERP Z)
		     (NUMBERP V)
		     (LESSP V 2))
		(EQUAL (QUOTIENT (PLUS V
				       (PLUS X (PLUS X (TIMES 2 Z))))
				 2)
		       (PLUS X Z))),

  which we would normally push and work on later by induction.  But
  if we must use induction to prove the input conjecture, we prefer
  to induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us return to:

(EQUAL (QUOTIENT (PLUS X (PLUS X Y)) 2)
       (PLUS X (QUOTIENT Y 2))).

We named this *1.  Let us appeal to the induction principle.  Four
inductions are suggested by terms in the conjecture.  They merge into
two likely candidate inductions.  However, only one is unflawed.  We
will induct according to the following scheme:
      (AND (IMPLIES (ZEROP X) (P X Y))
	   (IMPLIES (AND (NOT (ZEROP X)) (P (SUB1 X) Y))
		    (P X Y))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the
definition of ZEROP establish that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme produces two new
conjectures:

Case 2. (IMPLIES (ZEROP X)
		 (EQUAL (QUOTIENT (PLUS X (PLUS X Y)) 2)
			(PLUS X (QUOTIENT Y 2)))),

  which we simplify, unfolding the definitions of ZEROP, EQUAL, and
  PLUS, to two new conjectures:

  Case 2.2.
          (IMPLIES (AND (EQUAL X 0) (NOT (NUMBERP Y)))
		   (EQUAL (QUOTIENT 0 2)
			  (QUOTIENT Y 2))),

    which we again simplify, opening up QUOTIENT, LESSP, NUMBERP, and
    EQUAL, to:

          T.

  Case 2.1.
          (IMPLIES (AND (NOT (NUMBERP X))
			(NOT (NUMBERP Y)))
		   (EQUAL (QUOTIENT 0 2)
			  (QUOTIENT Y 2))),

    which we again simplify, opening up QUOTIENT, LESSP, NUMBERP, and
    EQUAL, to:

          T.

Case 1. (IMPLIES
	       (AND (NOT (ZEROP X))
		    (EQUAL (QUOTIENT (PLUS (SUB1 X) (PLUS (SUB1 X) Y))
				     2)
			   (PLUS (SUB1 X) (QUOTIENT Y 2))))
	       (EQUAL (QUOTIENT (PLUS X (PLUS X Y)) 2)
		      (PLUS X (QUOTIENT Y 2)))).

  This simplifies, applying the lemmas PLUS-ADD1, DIFFERENCE-2, and
  SUB1-ADD1, and opening up the functions ZEROP, PLUS, LESSP, SUB1,
  NUMBERP, EQUAL, and QUOTIENT, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 10.2180012 0.54799805 ]

HALF-PLUS 


(PROVE-LEMMA SIGMA-IS-HALF-PRODUCT
	     (REWRITE)
	     (EQUAL (SIGMA 0. I)
		    (QUOTIENT (TIMES I (ADD1 I)) 2.)))
This conjecture simplifies, rewriting with the lemma TIMES-ADD1, to
the following two new goals:

Case 2. (IMPLIES (NOT (NUMBERP I))
		 (EQUAL (SIGMA 0 I)
			(QUOTIENT 0 2))),

  which we again simplify, expanding LESSP, SIGMA, QUOTIENT, and
  EQUAL, to:

        T.

Case 1. (IMPLIES (NUMBERP I)
		 (EQUAL (SIGMA 0 I)
			(QUOTIENT (PLUS I (TIMES I I)) 2))).

  Give the above formula the name *1.


     Let us appeal to the induction principle.  The recursive terms
in the conjecture suggest three inductions.  However, they merge into
one likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (AND (LESSP 0 I) (P (SUB1 I)))
		    (P I))
	   (IMPLIES ( LEQ I 0) (P I))).
Linear arithmetic and the lemmas COUNT-NUMBERP and COUNT-NOT-LESSP
can be used to show that the measure (COUNT I) decreases according to
the well-founded relation LESSP in each induction step of the scheme.
The above induction scheme produces two new conjectures:

Case 2. (IMPLIES
		(AND (LESSP 0 I)
		     (EQUAL (SIGMA 0 (SUB1 I))
			    (QUOTIENT (PLUS (SUB1 I)
					    (TIMES (SUB1 I) (SUB1 I)))
				      2))
		     (NUMBERP I))
		(EQUAL (SIGMA 0 I)
		       (QUOTIENT (PLUS I (TIMES I I)) 2))),

  which we simplify, rewriting with COMMUTATIVITY-OF-TIMES and
  PLUS-ADD1, and unfolding the functions EQUAL, LESSP, SIGMA, PLUS,
  and TIMES, to:

        (IMPLIES
	 (AND (NOT (EQUAL I 0))
	      (EQUAL (SIGMA 0 (SUB1 I))
		     (QUOTIENT (PLUS (SUB1 I)
				     (TIMES (SUB1 I) (SUB1 I)))
			       2))
	      (NUMBERP I))
	 (EQUAL
	  (ADD1 (PLUS (SUB1 I) (SIGMA 0 (SUB1 I))))
	  (QUOTIENT
		 (ADD1 (PLUS I
			     (PLUS (SUB1 I)
				   (PLUS (SUB1 I)
					 (TIMES (SUB1 I) (SUB1 I))))))
		 2))).

  Applying the lemma SUB1-ELIM, replace I by (ADD1 X) to eliminate
  (SUB1 I).  We use the type restriction lemma noted when SUB1 was
  introduced to restrict the new variable.  This produces:

        (IMPLIES
	  (AND (NUMBERP X)
	       (NOT (EQUAL (ADD1 X) 0))
	       (EQUAL (SIGMA 0 X)
		      (QUOTIENT (PLUS X (TIMES X X)) 2)))
	  (EQUAL (ADD1 (PLUS X (SIGMA 0 X)))
		 (QUOTIENT (ADD1 (PLUS (ADD1 X)
				       (PLUS X (PLUS X (TIMES X X)))))
			   2))),

  which we further simplify, rewriting with SUB1-ADD1, PLUS-ADD1,
  COMMUTATIVITY2-OF-PLUS, DIFFERENCE-2, and HALF-PLUS, and opening up
  PLUS, LESSP, SUB1, NUMBERP, EQUAL, and QUOTIENT, to:

        T.

Case 1. (IMPLIES (AND ( LEQ I 0) (NUMBERP I))
		 (EQUAL (SIGMA 0 I)
			(QUOTIENT (PLUS I (TIMES I I)) 2))),

  which simplifies, expanding the definitions of EQUAL, LESSP,
  NUMBERP, SIGMA, TIMES, PLUS, and QUOTIENT, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 10.9370117 0.3680013 ]

SIGMA-IS-HALF-PRODUCT 


(DCL H (X Y))

[ 4.9967448E-3 0.0 ]

H 


(ADD-AXIOM H-COMMUTIVITY2
	   (REWRITE)
	   (EQUAL (H X (H Y Z)) (H Y (H X Z))))

[ 0.0349934897 0.0 ]

H-COMMUTIVITY2 


(DEFN H-PR
      (L AC)
      (IF (NLISTP L)
	  AC
	  (H (CAR L) (H-PR (CDR L) AC))))
     Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT L) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, H-PR is accepted under the principle of definition.




[ 0.34199219 0.0369954426 ]

H-PR 


(DEFN H-AC
      (L AC)
      (IF (NLISTP L)
	  AC
	  (H-AC (CDR L) (H (CAR L) AC))))
     Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT L) decreases
according to the well-founded relation LESSP in each recursive call.
Hence, H-AC is accepted under the principle of definition.




[ 0.34099935 0.0380208334 ]

H-AC 


(PROVE-LEMMA H-LEMMA
	     (REWRITE)
	     (EQUAL (H-PR X (H Z A))
		    (H Z (H-PR X A))))

     Give the conjecture the name *1.


     Let us appeal to the induction principle.  The recursive terms
in the conjecture suggest two inductions.  However, they merge into
one likely candidate induction.  We will induct according to the
following scheme:
      (AND (IMPLIES (NLISTP X) (P X Z A))
	   (IMPLIES (AND (NOT (NLISTP X)) (P (CDR X) Z A))
		    (P X Z A))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step
of the scheme.  The above induction scheme generates two new
conjectures:

Case 2. (IMPLIES (NLISTP X)
		 (EQUAL (H-PR X (H Z A))
			(H Z (H-PR X A)))),

  which simplifies, opening up the definitions of NLISTP and H-PR, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP X))
		      (EQUAL (H-PR (CDR X) (H Z A))
			     (H Z (H-PR (CDR X) A))))
		 (EQUAL (H-PR X (H Z A))
			(H Z (H-PR X A)))).

  This simplifies, applying H-COMMUTIVITY2, and opening up the
  definitions of NLISTP and H-PR, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.193977864 0.162011718 ]

H-LEMMA 


(PROVE-LEMMA H-EQ
	     (REWRITE)
	     (EQUAL (H-AC L AC) (H-PR L AC))
	     ((INDUCT (H-AC L AC))))
This conjecture can be simplified, using the abbreviations NLISTP,
NOT, OR, AND, and H-LEMMA, to the following two new conjectures:

Case 2. (IMPLIES (NOT (LISTP L))
		 (EQUAL (H-AC L AC) (H-PR L AC))),

  which simplifies, unfolding the functions H-AC and H-PR, to:

        T.

Case 1. (IMPLIES (AND (LISTP L)
		      (EQUAL (H-AC (CDR L) (H (CAR L) AC))
			     (H (CAR L) (H-PR (CDR L) AC))))
		 (EQUAL (H-AC L AC) (H-PR L AC))),

  which we simplify, unfolding H-AC and H-PR, to:

        T.

Q.E.D.


[ 0.29501953 0.068977864 ]

H-EQ 


(DEFN F0
      (X)
      (IF (LESSP 100. X)
	  (DIFFERENCE X 10.)
	  91.))
     From the definition we can conclude that (NUMBERP (F0 X)) is a
theorem.




[ 0.031998698 0.0129882812 ]

F0 


(PROVE-LEMMA F0-SATISFIES-F91-EQUATION NIL
	     (EQUAL (F0 X)
		    (IF (LESSP 100. X)
			(DIFFERENCE X 10.)
			(F0 (F0 (PLUS X 11.))))))
This simplifies, appealing to the lemmas COMMUTATIVITY-OF-PLUS and
SUB1-ADD1, and expanding the functions F0, SUB1, NUMBERP, EQUAL, PLUS,
DIFFERENCE, and LESSP, to two new formulas:

Case 2. (IMPLIES (AND ( LEQ X 100)
		      (LESSP 99 (PLUS 10 X)))
		 (EQUAL 91
			(F0 (DIFFERENCE (PLUS 10 X) 9)))).

  This simplifies again, expanding F0, to the new conjecture:

        (IMPLIES (AND ( LEQ X 100)
		      (LESSP 99 (PLUS 10 X))
		      (LESSP 100
			     (DIFFERENCE (PLUS 10 X) 9)))
		 (EQUAL 91
			(DIFFERENCE (DIFFERENCE (PLUS 10 X) 9)
				    10))).

  However this simplifies again, using linear arithmetic, to the
  following two new conjectures:

  Case 2.2.
          (IMPLIES (AND (LESSP (PLUS 10 X) 9)
			( LEQ X 100)
			(LESSP 99 (PLUS 10 X))
			(LESSP 100
			       (DIFFERENCE (PLUS 10 X) 9)))
		   (EQUAL 91
			  (DIFFERENCE (DIFFERENCE (PLUS 10 X) 9)
				      10))),

    which we again simplify, using linear arithmetic, to:

          T.

  Case 2.1.
          (IMPLIES (AND (LESSP (DIFFERENCE (PLUS 10 X) 9)
			       10)
			( LEQ X 100)
			(LESSP 99 (PLUS 10 X))
			(LESSP 100
			       (DIFFERENCE (PLUS 10 X) 9)))
		   (EQUAL 91
			  (DIFFERENCE (DIFFERENCE (PLUS 10 X) 9)
				      10))),

    which again simplifies, using linear arithmetic, to:

          T.

Case 1. (IMPLIES (AND ( LEQ X 100)
		      ( LEQ (PLUS 10 X) 99))
		 (EQUAL 91 (F0 91))),

  which we again simplify, unfolding F0 and EQUAL, to:

        T.

Q.E.D.


[ 2.50904948 0.185970051 ]

F0-SATISFIES-F91-EQUATION 


(REFLECT F91 F0-SATISFIES-F91-EQUATION
	 ((LESSP (DIFFERENCE 101. X))))
     Linear arithmetic, the lemmas COMMUTATIVITY-OF-PLUS,
EQUAL-DIFFERENCE-0, and DIFFERENCE-0, and the definitions of F0,
LESSP, and EQUAL establish that the measure (DIFFERENCE 101. X)
decreases according to the well-founded relation LESSP in each
recursive call.  Hence, F91 is accepted under the principle of
definition.  Note that (NUMBERP (F91 X)) is a theorem.




[ 0.952978514 0.076025391 ]

F91 


(PROVE-LEMMA F91-IS-F0
	     (REWRITE)
	     (EQUAL (F91 X) (F0 X)))
This formula simplifies, expanding the definition of F0, to the
following two new formulas:

Case 2. (IMPLIES ( LEQ X 100)
		 (EQUAL (F91 X) 91)).

  Give the above formula the name *1.

Case 1. (IMPLIES (LESSP 100 X)
		 (EQUAL (F91 X) (DIFFERENCE X 10))),

  which again simplifies, unfolding the definition of F91, to:

        T.


     So next consider:

      (IMPLIES ( LEQ X 100)
	       (EQUAL (F91 X) 91)),

which we named *1 above.  We will try to prove it by induction.  Two
inductions are suggested by terms in the conjecture, both of which
are unflawed.  So we will choose the one suggested by the largest
number of nonprimitive recursive functions.  We will induct according
to the following scheme:
      (AND (IMPLIES (LESSP 100 X) (P X))
	   (IMPLIES (AND ( LEQ X 100)
			 (P (F91 (PLUS X 11)))
			 (P (PLUS X 11)))
		    (P X))).
Linear arithmetic, the lemmas COMMUTATIVITY-OF-PLUS,
EQUAL-DIFFERENCE-0, and DIFFERENCE-0, and the definitions of F0,
LESSP, and EQUAL inform us that the measure (DIFFERENCE 101 X)
decreases according to the well-founded relation LESSP in each
induction step of the scheme.  The above induction scheme leads to
four new goals:

Case 4. (IMPLIES (AND (LESSP 100 (F91 (PLUS X 11)))
		      (LESSP 100 (PLUS X 11))
		      ( LEQ X 100))
		 (EQUAL (F91 X) 91)).

  This simplifies, appealing to the lemma COMMUTATIVITY-OF-PLUS, and
  opening up F91, to:

        (IMPLIES (AND (LESSP 100 (F91 (PLUS X 11)))
		      (LESSP 100 (PLUS 11 X))
		      ( LEQ X 100))
		 (EQUAL (F91 (F91 (PLUS X 11))) 91)),

  which we further simplify, rewriting with COMMUTATIVITY-OF-PLUS,
  and opening up F91, to:

        (IMPLIES (AND (LESSP 100
			     (DIFFERENCE (PLUS 11 X) 10))
		      (LESSP 100 (PLUS 11 X))
		      ( LEQ X 100))
		 (EQUAL (DIFFERENCE (DIFFERENCE (PLUS 11 X) 10)
				    10)
			91)).

  This simplifies again, using linear arithmetic, to two new formulas:

  Case 4.2.
          (IMPLIES (AND (LESSP (DIFFERENCE (PLUS 11 X) 10)
			       10)
			(LESSP 100
			       (DIFFERENCE (PLUS 11 X) 10))
			(LESSP 100 (PLUS 11 X))
			( LEQ X 100))
		   (EQUAL (DIFFERENCE (DIFFERENCE (PLUS 11 X) 10)
				      10)
			  91)),

    which again simplifies, using linear arithmetic, to:

          (IMPLIES (AND (LESSP (PLUS 11 X) 10)
			(LESSP (DIFFERENCE (PLUS 11 X) 10)
			       10)
			(LESSP 100
			       (DIFFERENCE (PLUS 11 X) 10))
			(LESSP 100 (PLUS 11 X))
			( LEQ X 100))
		   (EQUAL (DIFFERENCE (DIFFERENCE (PLUS 11 X) 10)
				      10)
			  91)).

    However this simplifies again, using linear arithmetic, to:

          T.

  Case 4.1.
          (IMPLIES (AND (LESSP (PLUS 11 X) 10)
			(LESSP 100
			       (DIFFERENCE (PLUS 11 X) 10))
			(LESSP 100 (PLUS 11 X))
			( LEQ X 100))
		   (EQUAL (DIFFERENCE (DIFFERENCE (PLUS 11 X) 10)
				      10)
			  91)).

    But this simplifies again, using linear arithmetic, to:

          T.

Case 3. (IMPLIES (AND (EQUAL (F91 (F91 (PLUS X 11))) 91)
		      (LESSP 100 (PLUS X 11))
		      ( LEQ X 100))
		 (EQUAL (F91 X) 91)).

  This simplifies, rewriting with COMMUTATIVITY-OF-PLUS, and
  unfolding the definitions of F91 and EQUAL, to:

        T.

Case 2. (IMPLIES (AND (LESSP 100 (F91 (PLUS X 11)))
		      (EQUAL (F91 (PLUS X 11)) 91)
		      ( LEQ X 100))
		 (EQUAL (F91 X) 91)),

  which simplifies, using linear arithmetic, to:

        T.

Case 1. (IMPLIES (AND (EQUAL (F91 (F91 (PLUS X 11))) 91)
		      (EQUAL (F91 (PLUS X 11)) 91)
		      ( LEQ X 100))
		 (EQUAL (F91 X) 91)),

  which we simplify, opening up F91 and EQUAL, to:

        (IMPLIES (AND (EQUAL (F91 (PLUS X 11)) 91)
		      ( LEQ X 100))
		 (EQUAL (F91 (F91 (PLUS X 11))) 91)),

  which again simplifies, unfolding the definitions of F91 and EQUAL,
  to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 3.3899577 0.493050132 ]

F91-IS-F0 


(DEFN EVEN
      (X)
      (EQUAL 0. (REMAINDER X 2.)))
     Note that (OR (FALSEP (EVEN X)) (TRUEP (EVEN X))) is a theorem.




[ 0.0260091147 0.0110026042 ]

EVEN 


(DEFN SQUARE (X) (TIMES X X))
     Observe that (NUMBERP (SQUARE X)) is a theorem.




[ 0.0239908854 9.0006511E-3 ]

SQUARE 


(PROVE-LEMMA TIMES-1
	     (REWRITE)
	     (EQUAL (TIMES 1. X) (FIX X)))
This conjecture simplifies, expanding the definition of FIX, to two
new goals:

Case 2. (IMPLIES (NOT (NUMBERP X))
		 (EQUAL (TIMES 1 X) 0)),

  which we again simplify, rewriting with TIMES-ZERO2, and unfolding
  the definition of EQUAL, to:

        T.

Case 1. (IMPLIES (NUMBERP X)
		 (EQUAL (TIMES 1 X) X)).

  This simplifies again, using linear arithmetic, to:

        T.

Q.E.D.


[ 0.157014973 0.0599934896 ]

TIMES-1 


(PROVE-LEMMA TIMES-2
	     (REWRITE)
	     (EQUAL (TIMES 2. X) (PLUS X X)))
This conjecture simplifies, using linear arithmetic, to:

      T.

Q.E.D.


[ 0.0479817707 0.016015625 ]

TIMES-2 


(PROVE-LEMMA EXP-OF-0
	     (REWRITE)
	     (EQUAL (EXP 0. K)
		    (IF (ZEROP K) 1. 0.)))
This formula simplifies, opening up the definitions of TIMES, EQUAL,
EXP, and ZEROP, to:

      T.

Q.E.D.


[ 0.57399089 0.0200032552 ]

EXP-OF-0 


(PROVE-LEMMA EXP-OF-1
	     (REWRITE)
	     (EQUAL (EXP 1. K) 1.))

     Call the conjecture *1.


     We will appeal to induction.  There is only one plausible
induction.  We will induct according to the following scheme:
      (AND (IMPLIES (ZEROP K) (P K))
	   (IMPLIES (AND (NOT (ZEROP K)) (P (SUB1 K)))
		    (P K))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP establish that the measure (COUNT K) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme generates two new goals:

Case 2. (IMPLIES (ZEROP K)
		 (EQUAL (EXP 1 K) 1)),

  which we simplify, unfolding ZEROP, EXP, and EQUAL, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP K))
		      (EQUAL (EXP 1 (SUB1 K)) 1))
		 (EQUAL (EXP 1 K) 1)),

  which simplifies, expanding the definitions of ZEROP, EXP, TIMES,
  and EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 0.418017577 0.135986328 ]

EXP-OF-1 


(PROVE-LEMMA EXP-BY-0
	     (REWRITE)
	     (EQUAL (EXP X 0.) 1.))
This simplifies, opening up the definitions of EQUAL and EXP, to:

      T.

Q.E.D.


[ 0.047998047 0.015999349 ]

EXP-BY-0 


(PROVE-LEMMA EXP-TIMES
	     (REWRITE)
	     (EQUAL (EXP (TIMES I J) K)
		    (TIMES (EXP I K) (EXP J K))))

     Give the conjecture the name *1.


     We will try to prove it by induction.  Four inductions are
suggested by terms in the conjecture.  They merge into two likely
candidate inductions.  However, only one is unflawed.  We will induct
according to the following scheme:
      (AND (IMPLIES (ZEROP K) (P I J K))
	   (IMPLIES (AND (NOT (ZEROP K)) (P I J (SUB1 K)))
		    (P I J K))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP establish that the measure (COUNT K) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme leads to the following two new goals:

Case 2. (IMPLIES (ZEROP K)
		 (EQUAL (EXP (TIMES I J) K)
			(TIMES (EXP I K) (EXP J K)))),

  which simplifies, rewriting with EXP-BY-0, and expanding the
  functions ZEROP, TIMES, EQUAL, and EXP, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP K))
		      (EQUAL (EXP (TIMES I J) (SUB1 K))
			     (TIMES (EXP I (SUB1 K))
				    (EXP J (SUB1 K)))))
		 (EQUAL (EXP (TIMES I J) K)
			(TIMES (EXP I K) (EXP J K)))),

  which we simplify, applying ASSOCIATIVITY-OF-TIMES and
  COMMUTATIVITY2-OF-TIMES, and opening up ZEROP and EXP, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 3.23902994 0.174967447 ]

EXP-TIMES 


(PROVE-LEMMA EXP-EXP
	     (REWRITE)
	     (EQUAL (EXP (EXP I J) K)
		    (EXP I (TIMES J K))))

     Give the conjecture the name *1.


     Let us appeal to the induction principle.  The recursive terms
in the conjecture suggest three inductions.  They merge into two
likely candidate inductions.  However, only one is unflawed.  We will
induct according to the following scheme:
      (AND (IMPLIES (ZEROP J) (P I J K))
	   (IMPLIES (AND (NOT (ZEROP J)) (P I (SUB1 J) K))
		    (P I J K))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP inform us that the measure (COUNT J) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme generates two new conjectures:

Case 2. (IMPLIES (ZEROP J)
		 (EQUAL (EXP (EXP I J) K)
			(EXP I (TIMES J K)))),

  which simplifies, applying the lemmas EXP-BY-0 and EXP-OF-1, and
  unfolding ZEROP, EQUAL, TIMES, and EXP, to:

        T.

Case 1. (IMPLIES (AND (NOT (ZEROP J))
		      (EQUAL (EXP (EXP I (SUB1 J)) K)
			     (EXP I (TIMES (SUB1 J) K))))
		 (EQUAL (EXP (EXP I J) K)
			(EXP I (TIMES J K)))),

  which simplifies, applying EXP-TIMES and EXP-PLUS, and expanding
  the definitions of ZEROP, EXP, and TIMES, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 2.01796874 0.195019532 ]

EXP-EXP 


(PROVE-LEMMA REMAINDER-PLUS-TIMES-1
	     (REWRITE)
	     (EQUAL (REMAINDER (PLUS X (TIMES I J)) J)
		    (REMAINDER X J)))
.

Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace X by
(PLUS Z (TIMES J V)) to eliminate (REMAINDER X J) and (QUOTIENT X J).
We employ LESSP-REMAINDER2, the type restriction lemma noted when
REMAINDER was introduced, and the type restriction lemma noted when
QUOTIENT was introduced to restrict the new variables.  We would thus
like to prove four new conjectures:

Case 4. (IMPLIES (NOT (NUMBERP X))
		 (EQUAL (REMAINDER (PLUS X (TIMES I J)) J)
			(REMAINDER X J))),

  which simplifies, applying the lemma DIVIDES-TIMES, and unfolding
  PLUS, LESSP, REMAINDER, and EQUAL, to:

        T.

Case 3. (IMPLIES (EQUAL J 0)
		 (EQUAL (REMAINDER (PLUS X (TIMES I J)) J)
			(REMAINDER X J))),

  which simplifies, applying COMMUTATIVITY-OF-TIMES and
  COMMUTATIVITY-OF-PLUS, and expanding the definitions of EQUAL,
  TIMES, PLUS, and REMAINDER, to:

        T.

Case 2. (IMPLIES (NOT (NUMBERP J))
		 (EQUAL (REMAINDER (PLUS X (TIMES I J)) J)
			(REMAINDER X J))),

  which simplifies, rewriting with TIMES-ZERO2, COMMUTATIVITY-OF-PLUS,
  and REMAINDER-WRT-12, and opening up EQUAL and PLUS, to:

        T.

Case 1. (IMPLIES (AND (NUMBERP Z)
		      (EQUAL (LESSP Z J) (NOT (ZEROP J)))
		      (NUMBERP V)
		      (NUMBERP J)
		      (NOT (EQUAL J 0)))
		 (EQUAL (REMAINDER (PLUS (PLUS Z (TIMES J V))
					 (TIMES I J))
				   J)
			Z)),

  which simplifies, appealing to the lemmas COMMUTATIVITY-OF-PLUS and
  ASSOCIATIVITY-OF-PLUS, and unfolding the definitions of ZEROP and
  NOT, to:

        (IMPLIES
	       (AND (NUMBERP Z)
		    (LESSP Z J)
		    (NUMBERP V)
		    (NUMBERP J)
		    (NOT (EQUAL J 0)))
	       (EQUAL (REMAINDER (PLUS Z
				       (PLUS (TIMES I J) (TIMES J V)))
				 J)
		      Z)),

  which we would normally push and work on later by induction.  But
  if we must use induction to prove the input conjecture, we prefer
  to induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us consider:

(EQUAL (REMAINDER (PLUS X (TIMES I J)) J)
       (REMAINDER X J)).

We named this *1 above.  Let us appeal to the induction principle.
Three inductions are suggested by terms in the conjecture.  However,
only one is unflawed.  We will induct according to the following
scheme:
      (AND (IMPLIES (ZEROP I) (P X I J))
	   (IMPLIES (AND (NOT (ZEROP I)) (P X (SUB1 I) J))
		    (P X I J))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of
ZEROP establish that the measure (COUNT I) decreases according to the
well-founded relation LESSP in each induction step of the scheme.
The above induction scheme generates two new formulas:

Case 2. (IMPLIES (ZEROP I)
		 (EQUAL (REMAINDER (PLUS X (TIMES I J)) J)
			(REMAINDER X J))),

  which simplifies, applying COMMUTATIVITY-OF-PLUS, and expanding
  ZEROP, EQUAL, TIMES, and PLUS, to two new conjectures:

  Case 2.2.
          (IMPLIES (AND (EQUAL I 0) (NOT (NUMBERP X)))
		   (EQUAL (REMAINDER 0 J)
			  (REMAINDER X J))).

    However this again simplifies, rewriting with the lemma
    REMAINDER-0-CROCK, and unfolding the definitions of LESSP,
    REMAINDER, and EQUAL, to:

          T.

  Case 2.1.
          (IMPLIES (AND (NOT (NUMBERP I))
			(NOT (NUMBERP X)))
		   (EQUAL (REMAINDER 0 J)
			  (REMAINDER X J))),

    which again simplifies, rewriting with REMAINDER-0-CROCK, and
    unfolding the functions LESSP, REMAINDER, and EQUAL, to:

          T.

Case 1. (IMPLIES (AND (NOT (ZEROP I))
		      (EQUAL (REMAINDER (PLUS X (TIMES (SUB1 I) J))
					J)
			     (REMAINDER X J)))
		 (EQUAL (REMAINDER (PLUS X (TIMES I J)) J)
			(REMAINDER X J))).

  This simplifies, applying COMMUTATIVITY2-OF-PLUS and
  DIFFERENCE-PLUS1, and opening up ZEROP, TIMES, REMAINDER, EQUAL,
  and PLUS, to the following three new conjectures:

  Case 1.3.
          (IMPLIES (AND (NOT (EQUAL I 0))
			(NUMBERP I)
			(EQUAL (REMAINDER (PLUS X (TIMES (SUB1 I) J))
					  J)
			       (REMAINDER X J))
			(NOT (EQUAL J 0))
			(NUMBERP J)
			(LESSP (PLUS J (PLUS X (TIMES (SUB1 I) J)))
			       J))
		   (EQUAL (PLUS J (PLUS X (TIMES (SUB1 I) J)))
			  (REMAINDER X J))).

    This again simplifies, using linear arithmetic, to:

          T.

  Case 1.2.
          (IMPLIES (AND (NOT (EQUAL I 0))
			(NUMBERP I)
			(EQUAL (REMAINDER (PLUS X (TIMES (SUB1 I) J))
					  J)
			       (REMAINDER X J))
			(EQUAL J 0))
		   (EQUAL (PLUS X (TIMES (SUB1 I) J))
			  (REMAINDER X J))),

    which again simplifies, applying COMMUTATIVITY-OF-TIMES and
    COMMUTATIVITY-OF-PLUS, and opening up the functions EQUAL, TIMES,
    PLUS, and REMAINDER, to:

          T.

  Case 1.1.
          (IMPLIES (AND (NOT (EQUAL I 0))
			(NUMBERP I)
			(EQUAL (REMAINDER (PLUS X (TIMES (SUB1 I) J))
					  J)
			       (REMAINDER X J))
			(NOT (NUMBERP J)))
		   (EQUAL (PLUS X (TIMES (SUB1 I) J))
			  (REMAINDER X J))).

    But this simplifies again, applying REMAINDER-WRT-12 and
    EQUAL-TIMES-0, and opening up the definition of PLUS, to:

          T.


     That finishes the proof of *1.  Q.E.D.


[ 15.2569987 0.61401367 ]

REMAINDER-PLUS-TIMES-1 


(PROVE-LEMMA REMAINDER-PLUS-TIMES-2
	     (REWRITE)
	     (EQUAL (REMAINDER (PLUS X (TIMES J I)) J)
		    (REMAINDER X J)))
This formula simplifies, rewriting with COMMUTATIVITY-OF-TIMES and
REMAINDER-PLUS-TIMES-1, to:

      T.

Q.E.D.


[ 0.72400716 0.0189941407 ]

REMAINDER-PLUS-TIMES-2 


(PROVE-LEMMA REMAINDER-TIMES-1
	     (REWRITE)
	     (EQUAL (REMAINDER (TIMES B (TIMES A C)) A)
		    0.))
This formula simplifies, applying the lemmas COMMUTATIVITY2-OF-TIMES
and REMAINDER-TIMES, and opening up EQUAL, to:

      T.

Q.E.D.


[ 0.30299479 0.0209960938 ]

REMAINDER-TIMES-1 


(PROVE-LEMMA REMAINDER-OF-1
	     (REWRITE)
	     (EQUAL (REMAINDER 1. X)
		    (IF (EQUAL X 1.) 0. 1.)))
This formula simplifies, applying REMAINDER-0-CROCK and DIFFERENCE-0,
and opening up DIFFERENCE, EQUAL, SUB1, LESSP, NUMBERP, and REMAINDER,
to the following four new goals:

Case 4. (IMPLIES (AND (NOT (EQUAL X 1))
		      (NOT (EQUAL X 0))
		      (NUMBERP X))
		 (LESSP 1 X)),

  which we again simplify, using linear arithmetic, to:

        T.

Case 3. (IMPLIES (EQUAL X 1) ( LEQ X 1)).

  However this again simplifies, using linear arithmetic, to:

        T.

Case 2. (IMPLIES (EQUAL X 1) (NUMBERP X)),

  which we again simplify, obviously, to:

        T.

Case 1. (IMPLIES (EQUAL X 1)
		 (NOT (EQUAL X 0))).

  This again simplifies, using linear arithmetic, to:

        T.

Q.E.D.


[ 0.306966145 0.104020182 ]

REMAINDER-OF-1 


(PROVE-LEMMA EQUAL-LENGTH-0
	     (REWRITE)
	     (EQUAL (EQUAL (LENGTH X) 0.)
		    (NLISTP X)))
This conjecture simplifies, unfolding the function NLISTP, to two new
conjectures:

Case 2. (IMPLIES (NOT (EQUAL (LENGTH X) 0))
		 (LISTP X)).

  However this simplifies again, opening up the definitions of LENGTH
  and EQUAL, to:

        T.

Case 1. (IMPLIES (EQUAL (LENGTH X) 0)
		 (NOT (LISTP X))),

  which we will name *1.


     Let us appeal to the induction principle.  There is only one
plausible induction.  We will induct according to the following
scheme:
      (AND (IMPLIES (AND (LISTP X) (P (CDR X)))
		    (P X))
	   (IMPLIES (NOT (LISTP X)) (P X))).
Linear arithmetic and the lemma CDR-LESSP can be used to establish
that the measure (COUNT X) decreases according to the well-founded
relation LESSP in each induction step of the scheme.  The above
induction scheme produces the following two new formulas:

Case 2. (IMPLIES (AND (NOT (EQUAL (LENGTH (CDR X)) 0))
		      (EQUAL (LENGTH X) 0))
		 (NOT (LISTP X))).

  This simplifies, opening up LENGTH, to:

        T.

Case 1. (IMPLIES (AND (NOT (LISTP (CDR X)))
		      (EQUAL (LENGTH X) 0))
		 (NOT (LISTP X))).

  This simplifies, expanding LENGTH, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 1.47397462 0.177034505 ]

EQUAL-LENGTH-0 


(PROVE-LEMMA LENGTH-DELETE
	     (REWRITE)
	     (EQUAL (LENGTH (DELETE X L))
		    (IF (MEMBER X L)
			(LENGTH (CDR L))
			(LENGTH L))))
This conjecture simplifies, unfolding the functions DELETE, MEMBER,
and LENGTH, to three new conjectures:

Case 3. (IMPLIES (AND (LISTP L)
		      (NOT (EQUAL X (CAR L)))
		      (NOT (MEMBER X (CDR L))))
		 (EQUAL (LENGTH (CONS (CAR L) (DELETE X (CDR L))))
			(ADD1 (LENGTH (CDR L))))).

  However this simplifies again, applying the lemmas
  DELETE-NON-MEMBER and CONS-CAR-CDR, and expanding the definition of
  LENGTH, to:

        T.

Case 2. (IMPLIES (AND (LISTP L)
		      (NOT (EQUAL X (CAR L)))
		      (MEMBER X (CDR L)))
		 (EQUAL (LENGTH (CONS (CAR L) (DELETE X (CDR L))))
			(LENGTH (CDR L)))),

  which again simplifies, rewriting with CDR-CONS, and opening up
  LENGTH, to:

        (IMPLIES (AND (LISTP L)
		      (NOT (EQUAL X (CAR L)))
		      (MEMBER X (CDR L)))
		 (EQUAL (ADD1 (LENGTH (DELETE X (CDR L))))
			(LENGTH (CDR L)))).

  Appealing to the lemma CAR-CDR-ELIM, replace L by (CONS Z V) to
  eliminate (CAR L) and (CDR L).  This generates:

        (IMPLIES (AND (NOT (EQUAL X Z)) (MEMBER X V))
		 (EQUAL (ADD1 (LENGTH (DELETE X V)))
			(LENGTH V))),

  which we would usually push and work on later by induction.  But if
  we must use induction to prove the input conjecture, we prefer to
  induct on the original formulation of the problem.  Thus we will
  disregard all that we have previously done, give the name *1 to the
  original input, and work on it.


     So now let us consider:

(EQUAL (LENGTH (DELETE X L))
       (IF (MEMBER X L)
	   (LENGTH (CDR L))
	   (LENGTH L))),

named *1 above.  Let us appeal to the induction principle.  The
recursive terms in the conjecture suggest three inductions.  However,
they merge into one likely candidate induction.  We will induct
according to the following scheme:
      (AND (IMPLIES (AND (LISTP L) (EQUAL X (CAR L)))
		    (P X L))
	   (IMPLIES (AND (LISTP L)
			 (NOT (EQUAL X (CAR L)))
			 (P X (CDR L)))
		    (P X L))
	   (IMPLIES (NOT (LISTP L)) (P X L))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT L) decreases according to the well-founded relation LESSP in
each induction step of the scheme.  The above induction scheme
generates three new conjectures:

Case 3. (IMPLIES (AND (LISTP L) (EQUAL X (CAR L)))
		 (EQUAL (LENGTH (DELETE X L))
			(IF (MEMBER X L)
			    (LENGTH (CDR L))
			    (LENGTH L)))),

  which we simplify, unfolding DELETE and MEMBER, to:

        T.

Case 2. (IMPLIES (AND (LISTP L)
		      (NOT (EQUAL X (CAR L)))
		      (EQUAL (LENGTH (DELETE X (CDR L)))
			     (IF (MEMBER X (CDR L))
				 (LENGTH (CDDR L))
				 (LENGTH (CDR L)))))
		 (EQUAL (LENGTH (DELETE X L))
			(IF (MEMBER X L)
			    (LENGTH (CDR L))
			    (LENGTH L)))),

  which simplifies, rewriting with DELETE-NON-MEMBER and CDR-CONS,
  and expanding the definitions of MEMBER, LENGTH, and DELETE, to the
  new conjecture:

        (IMPLIES (AND (LISTP L)
		      (NOT (EQUAL X (CAR L)))
		      (MEMBER X (CDR L))
		      (EQUAL (LENGTH (DELETE X (CDR L)))
			     (LENGTH (CDDR L))))
		 (EQUAL (ADD1 (LENGTH (CDDR L)))
			(LENGTH (CDR L)))),

  which we further simplify, unfolding the definitions of MEMBER,
  DELETE, and LENGTH, to:

        T.

Case 1. (IMPLIES (NOT (LISTP L))
		 (EQUAL (LENGTH (DELETE X L))
			(IF (MEMBER X L)
			    (LENGTH (CDR L))
			    (LENGTH L)))),

  which simplifies, rewriting with DELETE-NON-MEMBER, and unfolding
  the functions MEMBER, LENGTH, and EQUAL, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 5.51899415 0.443994142 ]

LENGTH-DELETE 


(PROVE-LEMMA REMAINDER-DIFFERENCE-TIMES
	     (REWRITE)
	     (EQUAL (REMAINDER (DIFFERENCE (TIMES P X) (TIMES P Y))
			       P)
		    0.)
	     ((USE (DIVIDES-TIMES (X (DIFFERENCE X Y))
				  (Z P)))
	      (DISABLE DIVIDES-TIMES)))
This formula simplifies, applying COMMUTATIVITY-OF-TIMES,
TIMES-DIFFERENCE, REMAINDER-TIMES, and EUCLID, and opening up EQUAL,
to:

      T.

Q.E.D.


[ 13.4119954 0.114990234 ]

REMAINDER-DIFFERENCE-TIMES 


(PROVE-LEMMA PRIME-KEY-REWRITE
	     (REWRITE)
	     (IMPLIES (PRIME P)
		      (EQUAL (EQUAL (REMAINDER (TIMES A B) P) 0.)
			     (OR (EQUAL (REMAINDER A P) 0.)
				 (EQUAL (REMAINDER B P) 0.))))
	     ((USE (PRIME-KEY (X P)
			      (B A)
			      (Z B)
			      (K (QUOTIENT (TIMES A B) P)))
		   (REMAINDER-QUOTIENT (X (TIMES A B))
				       (Y P)))
	      (DISABLE PRIME-KEY REMAINDER-QUOTIENT)))
This formula can be simplified, using the abbreviations PRIME,
IMPLIES, AND, and DIVIDES, to the new conjecture:

      (IMPLIES
       (AND
	   (IMPLIES (AND (NUMBERP B)
			 (AND (PRIME P)
			      (AND (NOT (EQUAL (REMAINDER B P) 0))
				   (NOT (EQUAL (REMAINDER A P) 0)))))
		    (NOT (EQUAL (TIMES P (QUOTIENT (TIMES A B) P))
				(TIMES A B))))
	   (EQUAL (PLUS (REMAINDER (TIMES A B) P)
			(TIMES P (QUOTIENT (TIMES A B) P)))
		  (FIX (TIMES A B)))
	   (NOT (EQUAL P 0))
	   (NUMBERP P)
	   (NOT (EQUAL P 1))
	   (PRIME1 P (SUB1 P)))
       (EQUAL (EQUAL (REMAINDER (TIMES A B) P) 0)
	      (OR (EQUAL (REMAINDER A P) 0)
		  (EQUAL (REMAINDER B P) 0)))).

This simplifies, rewriting with TIMES-ZERO2, REMAINDER-0-CROCK,
COMMUTATIVITY-OF-TIMES, COMMUTATIVITY2-OF-PLUS, and QUOTIENT-DIVIDES,
and opening up the definitions of PRIME, NOT, AND, TIMES, IMPLIES,
LESSP, EQUAL, QUOTIENT, PLUS, FIX, REMAINDER, and OR, to four new
conjectures:

Case 4. (IMPLIES
	    (AND (EQUAL (REMAINDER B P) 0)
		 (EQUAL (PLUS (QUOTIENT (TIMES A B) P)
			      (PLUS (REMAINDER (TIMES A B) P)
				    (TIMES (SUB1 P)
					   (QUOTIENT (TIMES A B) P))))
			(TIMES A B))
		 (NOT (EQUAL P 0))
		 (NUMBERP P)
		 (NOT (EQUAL P 1))
		 (PRIME1 P (SUB1 P)))
	    (EQUAL (REMAINDER (TIMES A B) P) 0)).

  Applying the lemma REMAINDER-QUOTIENT-ELIM, replace B by
  (PLUS X (TIMES P Z)) to eliminate (REMAINDER B P) and
  (QUOTIENT B P).  We use LESSP-REMAINDER2, the type restriction
  lemma noted when REMAINDER was introduced, and the type restriction
  lemma noted when QUOTIENT was introduced to constrain the new
  variables.  We must thus prove the following two new conjectures:

  Case 4.2.
          (IMPLIES
	    (AND (NOT (NUMBERP B))
		 (EQUAL (REMAINDER B P) 0)
		 (EQUAL (PLUS (QUOTIENT (TIMES A B) P)
			      (PLUS (REMAINDER (TIMES A B) P)
				    (TIMES (SUB1 P)
					   (QUOTIENT (TIMES A B) P))))
			(TIMES A B))
		 (NOT (EQUAL P 0))
		 (NUMBERP P)
		 (NOT (EQUAL P 1))
		 (PRIME1 P (SUB1 P)))
	    (EQUAL (REMAINDER (TIMES A B) P) 0)).

    This simplifies further, applying TIMES-ZERO2, REMAINDER-0-CROCK,
    and COMMUTATIVITY-OF-TIMES, and opening up LESSP, REMAINDER,
    EQUAL, QUOTIENT, TIMES, and PLUS, to:

          T.

  Case 4.1.
          (IMPLIES
	   (AND
	    (NUMBERP X)
	    (EQUAL (LESSP X P) (NOT (ZEROP P)))
	    (NUMBERP Z)
	    (EQUAL X 0)
	    (EQUAL
	     (PLUS
		 (QUOTIENT (TIMES A (PLUS X (TIMES P Z)))
			   P)
		 (PLUS (REMAINDER (TIMES A (PLUS X (TIMES P Z)))
				  P)
		       (TIMES (SUB1 P)
			      (QUOTIENT (TIMES A (PLUS X (TIMES P Z)))
					P))))
	     (TIMES A (PLUS X (TIMES P Z))))
	    (NOT (EQUAL P 0))
	    (NUMBERP P)
	    (NOT (EQUAL P 1))
	    (PRIME1 P (SUB1 P)))
	   (EQUAL (REMAINDER (TIMES A (PLUS X (TIMES P Z)))
			     P)
		  0)),

    which we further simplify, rewriting with REMAINDER-TIMES-1,
    COMMUTATIVITY-OF-TIMES, COMMUTATIVITY2-OF-TIMES, and
    DISTRIBUTIVITY-OF-DIVIDES, and unfolding the functions NUMBERP,
    EQUAL, LESSP, ZEROP, NOT, PLUS, and DIVIDES, to:

          T.

Case 3. (IMPLIES
	    (AND (EQUAL (REMAINDER A P) 0)
		 (EQUAL (PLUS (QUOTIENT (TIMES A B) P)
			      (PLUS (REMAINDER (TIMES A B) P)
				    (TIMES (SUB1 P)
					   (QUOTIENT (TIMES A B) P))))
			(TIMES A B))
		 (NOT (EQUAL P 0))
		 (NUMBERP P)
		 (NOT (EQUAL P 1))
		 (PRIME1 P (SUB1 P)))
	    (EQUAL (REMAINDER (TIMES A B) P) 0)).

  Appealing to the lemma REMAINDER-QUOTIENT-ELIM, replace A by
  (PLUS X (TIMES P Z)) to eliminate (REMAINDER A P) and
  (QUOTIENT A P).  We employ LESSP-REMAINDER2, the type restriction
  lemma noted when REMAINDER was introduced, and the type restriction
  lemma noted when QUOTIENT was introduced to restrict the new
  variables.  This produces two new formulas:

  Case 3.2.
          (IMPLIES
	    (AND (NOT (NUMBERP A))
		 (EQUAL (REMAINDER A P) 0)
		 (EQUAL (PLUS (QUOTIENT (TIMES A B) P)
			      (PLUS (REMAINDER (TIMES A B) P)
				    (TIMES (SUB1 P)
					   (QUOTIENT (TIMES A B) P))))
			(TIMES A B))
		 (NOT (EQUAL P 0))
		 (NUMBERP P)
		 (NOT (EQUAL P 1))
		 (PRIME1 P (SUB1 P)))
	    (EQUAL (REMAINDER (TIMES A B) P) 0)),

    which we further simplify, applying REMAINDER-0-CROCK and
    COMMUTATIVITY-OF-TIMES, and expanding the definitions of LESSP,
    REMAINDER, EQUAL, TIMES, QUOTIENT, and PLUS, to:

          T.

  Case 3.1.
          (IMPLIES
	   (AND
	    (NUMBERP X)
	    (EQUAL (LESSP X P) (NOT (ZEROP P)))
	    (NUMBERP Z)
	    (EQUAL X 0)
	    (EQUAL
	     (PLUS
		 (QUOTIENT (TIMES (PLUS X (TIMES P Z)) B)
			   P)
		 (PLUS (REMAINDER (TIMES (PLUS X (TIMES P Z)) B)
				  P)
		       (TIMES (SUB1 P)
			      (QUOTIENT (TIMES (PLUS X (TIMES P Z)) B)
					P))))
	     (TIMES (PLUS X (TIMES P Z)) B))
	    (NOT (EQUAL P 0))
	    (NUMBERP P)
	    (NOT (EQUAL P 1))
	    (PRIME1 P (SUB1 P)))
	   (EQUAL (REMAINDER (TIMES (PLUS X (TIMES P Z)) B)
			     P)
		  0)),

    which we further simplify, rewriting with COMMUTATIVITY-OF-TIMES,
    COMMUTATIVITY2-OF-TIMES, ASSOCIATIVITY-OF-TIMES,
    REMAINDER-TIMES-1, and DISTRIBUTIVITY-OF-DIVIDES, and unfolding
    NUMBERP, EQUAL, LESSP, ZEROP, NOT, PLUS, and DIVIDES, to:

          T.

Case 2. (IMPLIES
	    (AND (NOT (EQUAL (PLUS (QUOTIENT (TIMES A B) P)
				   (TIMES (SUB1 P)
					  (QUOTIENT (TIMES A B) P)))
			     (TIMES A B)))
		 (EQUAL (PLUS (QUOTIENT (TIMES A B) P)
			      (PLUS (REMAINDER (TIMES A B) P)
				    (TIMES (SUB1 P)
					   (QUOTIENT (TIMES A B) P))))
			(TIMES A B))
		 (NOT (EQUAL P 0))
		 (NUMBERP P)
		 (NOT (EQUAL P 1))
		 (PRIME1 P (SUB1 P)))
	    (NOT (EQUAL (REMAINDER A P) 0))).

  Applying the lemma REMAINDER-QUOTIENT-ELIM, replace A by
  (PLUS X (TIMES P Z)) to eliminate (REMAINDER A P) and
  (QUOTIENT A P).  We employ LESSP-REMAINDER2, the type restriction
  lemma noted when REMAINDER was introduced, and the type restriction
  lemma noted when QUOTIENT was introduced to constrain the new
  variables.  The result is the following two new formulas:

  Case 2.2.
          (IMPLIES
	    (AND (NOT (NUMBERP A))
		 (NOT (EQUAL (PLUS (QUOTIENT (TIMES A B) P)
				   (TIMES (SUB1 P)
					  (QUOTIENT (TIMES A B) P)))
			     (TIMES A B)))
		 (EQUAL (PLUS (QUOTIENT (TIMES A B) P)
			      (PLUS (REMAINDER (TIMES A B) P)
				    (TIMES (SUB1 P)
					   (QUOTIENT (TIMES A B) P))))
			(TIMES A B))
		 (NOT (EQUAL P 0))
		 (NUMBERP P)
		 (NOT (EQUAL P 1))
		 (PRIME1 P (SUB1 P)))
	    (NOT (EQUAL (REMAINDER A P) 0))).

    But this simplifies further, rewriting with
    COMMUTATIVITY-OF-TIMES, and expanding the functions TIMES, LESSP,
    EQUAL, QUOTIENT, and PLUS, to:

          T.

  Case 2.1.
          (IMPLIES
	   (AND
	    (NUMBERP X)
	    (EQUAL (LESSP X P) (NOT (ZEROP P)))
	    (NUMBERP Z)
	    (NOT
	     (EQUAL
		 (PLUS (QUOTIENT (TIMES (PLUS X (TIMES P Z)) B)
				 P)
		       (TIMES (SUB1 P)
			      (QUOTIENT (TIMES (PLUS X (TIMES P Z)) B)
					P)))
		 (TIMES (PLUS X (TIMES P Z)) B)))
	    (EQUAL
	     (PLUS
		 (QUOTIENT (TIMES (PLUS X (TIMES P Z)) B)
			   P)
		 (PLUS (REMAINDER (TIMES (PLUS X (TIMES P Z)) B)
				  P)
		       (TIMES (SUB1 P)
			      (QUOTIENT (TIMES (PLUS X (TIMES P Z)) B)
					P))))
	     (TIMES (PLUS X (TIMES P Z)) B))
	    (NOT (EQUAL P 0))
	    (NUMBERP P)
	    (NOT (EQUAL P 1))
	    (PRIME1 P (SUB1 P)))
	   (NOT (EQUAL X 0))).

    However this simplifies further, rewriting with the lemmas
    COMMUTATIVITY-OF-TIMES, COMMUTATIVITY2-OF-TIMES,
    ASSOCIATIVITY-OF-TIMES, REMAINDER-TIMES-1, and
    DISTRIBUTIVITY-OF-DIVIDES, and expanding the definitions of
    NUMBERP, EQUAL, LESSP, ZEROP, NOT, PLUS, and DIVIDES, to:

          T.

Case 1. (IMPLIES
	    (AND (NOT (EQUAL (PLUS (QUOTIENT (TIMES A B) P)
				   (TIMES (SUB1 P)
					  (QUOTIENT (TIMES A B) P)))
			     (TIMES A B)))
		 (EQUAL (PLUS (QUOTIENT (TIMES A B) P)
			      (PLUS (REMAINDER (TIMES A B) P)
				    (TIMES (SUB1 P)
					   (QUOTIENT (TIMES A B) P))))
			(TIMES A B))
		 (NOT (EQUAL P 0))
		 (NUMBERP P)
		 (NOT (EQUAL P 1))
		 (PRIME1 P (SUB1 P)))
	    (NOT (EQUAL (REMAINDER B P) 0))).

  Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace B by
  (PLUS X (TIMES P Z)) to eliminate (REMAINDER B P) and
  (QUOTIENT B P).  We rely upon LESSP-REMAINDER2, the type
  restriction lemma noted when REMAINDER was introduced, and the type
  restriction lemma noted when QUOTIENT was introduced to constrain
  the new variables.  This generates two new goals:

  Case 1.2.
          (IMPLIES
	    (AND (NOT (NUMBERP B))
		 (NOT (EQUAL (PLUS (QUOTIENT (TIMES A B) P)
				   (TIMES (SUB1 P)
					  (QUOTIENT (TIMES A B) P)))
			     (TIMES A B)))
		 (EQUAL (PLUS (QUOTIENT (TIMES A B) P)
			      (PLUS (REMAINDER (TIMES A B) P)
				    (TIMES (SUB1 P)
					   (QUOTIENT (TIMES A B) P))))
			(TIMES A B))
		 (NOT (EQUAL P 0))
		 (NUMBERP P)
		 (NOT (EQUAL P 1))
		 (PRIME1 P (SUB1 P)))
	    (NOT (EQUAL (REMAINDER B P) 0))),

    which further simplifies, applying TIMES-ZERO2 and
    COMMUTATIVITY-OF-TIMES, and opening up the functions LESSP, EQUAL,
    QUOTIENT, TIMES, and PLUS, to:

          T.

  Case 1.1.
          (IMPLIES
	   (AND
	    (NUMBERP X)
	    (EQUAL (LESSP X P) (NOT (ZEROP P)))
	    (NUMBERP Z)
	    (NOT
	     (EQUAL
		 (PLUS (QUOTIENT (TIMES A (PLUS X (TIMES P Z)))
				 P)
		       (TIMES (SUB1 P)
			      (QUOTIENT (TIMES A (PLUS X (TIMES P Z)))
					P)))
		 (TIMES A (PLUS X (TIMES P Z)))))
	    (EQUAL
	     (PLUS
		 (QUOTIENT (TIMES A (PLUS X (TIMES P Z)))
			   P)
		 (PLUS (REMAINDER (TIMES A (PLUS X (TIMES P Z)))
				  P)
		       (TIMES (SUB1 P)
			      (QUOTIENT (TIMES A (PLUS X (TIMES P Z)))
					P))))
	     (TIMES A (PLUS X (TIMES P Z))))
	    (NOT (EQUAL P 0))
	    (NUMBERP P)
	    (NOT (EQUAL P 1))
	    (PRIME1 P (SUB1 P)))
	   (NOT (EQUAL X 0))).

    But this simplifies further, applying REMAINDER-TIMES-1,
    COMMUTATIVITY-OF-TIMES, COMMUTATIVITY2-OF-TIMES, and
    DISTRIBUTIVITY-OF-DIVIDES, and opening up the definitions of
    NUMBERP, EQUAL, LESSP, ZEROP, NOT, PLUS, and DIVIDES, to:

          T.

Q.E.D.


[ 295.06795 2.0630371 ]

PRIME-KEY-REWRITE 


(PROVE-LEMMA TIMES-TIMES-LIST-DELETE
	     (REWRITE)
	     (IMPLIES (MEMBER X L)
		      (EQUAL (TIMES X (TIMES-LIST (DELETE X L)))
			     (TIMES-LIST L))))

     Name the conjecture *1.


     We will try to prove it by induction.  Four inductions are
suggested by terms in the conjecture.  They merge into two likely
candidate inductions.  However, only one is unflawed.  We will induct
according to the following scheme:
      (AND (IMPLIES (NLISTP L) (P X L))
	   (IMPLIES (AND (NOT (NLISTP L))
			 (EQUAL X (CAR L)))
		    (P X L))
	   (IMPLIES (AND (NOT (NLISTP L))
			 (NOT (EQUAL X (CAR L)))
			 (P X (CDR L)))
		    (P X L))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP can be used to prove that the measure (COUNT L)
decreases according to the well-founded relation LESSP in each
induction step of the scheme.  The above induction scheme produces
four new formulas:

Case 4. (IMPLIES (AND (NLISTP L) (MEMBER X L))
		 (EQUAL (TIMES X (TIMES-LIST (DELETE X L)))
			(TIMES-LIST L))).

  This simplifies, opening up the definitions of NLISTP and MEMBER,
  to:

        T.

Case 3. (IMPLIES (AND (NOT (NLISTP L))
		      (EQUAL X (CAR L))
		      (MEMBER X L))
		 (EQUAL (TIMES X (TIMES-LIST (DELETE X L)))
			(TIMES-LIST L))),

  which we simplify, opening up NLISTP, MEMBER, DELETE, and
  TIMES-LIST, to:

        T.

Case 2. (IMPLIES (AND (NOT (NLISTP L))
		      (NOT (EQUAL X (CAR L)))
		      (NOT (MEMBER X (CDR L)))
		      (MEMBER X L))
		 (EQUAL (TIMES X (TIMES-LIST (DELETE X L)))
			(TIMES-LIST L))),

  which we simplify, unfolding NLISTP and MEMBER, to:

        T.

Case 1. (IMPLIES (AND (NOT (NLISTP L))
		      (NOT (EQUAL X (CAR L)))
		      (EQUAL (TIMES X
				    (TIMES-LIST (DELETE X (CDR L))))
			     (TIMES-LIST (CDR L)))
		      (MEMBER X L))
		 (EQUAL (TIMES X (TIMES-LIST (DELETE X L)))
			(TIMES-LIST L))).

  This simplifies, rewriting with the lemmas CDR-CONS and CAR-CONS,
  and expanding NLISTP, MEMBER, DELETE, and TIMES-LIST, to:

        (IMPLIES
		(AND (LISTP L)
		     (NOT (EQUAL X (CAR L)))
		     (EQUAL (TIMES X
				   (TIMES-LIST (DELETE X (CDR L))))
			    (TIMES-LIST (CDR L)))
		     (MEMBER X (CDR L)))
		(EQUAL (TIMES X
			      (TIMES (CAR L)
				     (TIMES-LIST (DELETE X (CDR L)))))
		       (TIMES (CAR L)
			      (TIMES-LIST (CDR L))))).

  Applying the lemma CAR-CDR-ELIM, we now replace L by (CONS Z V) to
  eliminate (CAR L) and (CDR L).  This produces:

        (IMPLIES (AND (NOT (EQUAL X Z))
		      (EQUAL (TIMES X (TIMES-LIST (DELETE X V)))
			     (TIMES-LIST V))
		      (MEMBER X V))
		 (EQUAL (TIMES X
			       (TIMES Z (TIMES-LIST (DELETE X V))))
			(TIMES Z (TIMES-LIST V)))).

  We use the above equality hypothesis by substituting:
        (TIMES X (TIMES-LIST (DELETE X V)))
  for (TIMES-LIST V) and throwing away the equality.  We would thus
  like to prove:

        (IMPLIES (AND (NOT (EQUAL X Z)) (MEMBER X V))
		 (EQUAL (TIMES X
			       (TIMES Z (TIMES-LIST (DELETE X V))))
			(TIMES Z
			       (TIMES X
				      (TIMES-LIST (DELETE X V)))))),

  which we further simplify, rewriting with COMMUTATIVITY2-OF-TIMES,
  to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 39.495085 0.371940102 ]

TIMES-TIMES-LIST-DELETE 


(PROVE-LEMMA LESSP-REMAINDER-DIVISOR
	     (REWRITE)
	     (IMPLIES (NOT (ZEROP Y))
		      (LESSP (REMAINDER X Y) Y)))
This formula can be simplified, using the abbreviations ZEROP, NOT,
and IMPLIES, to:

      (IMPLIES (AND (NOT (EQUAL Y 0)) (NUMBERP Y))
	       (LESSP (REMAINDER X Y) Y)).

This simplifies, rewriting with LESSP-REMAINDER2, to:

      T.

Q.E.D.


[ 0.396972656 0.066048177 ]

LESSP-REMAINDER-DIVISOR 


(DCL APPLY2 (FN X Y))

[ 5.9895833E-3 0.0 ]

APPLY2 


(DEFN EVAL2
      (FORM ENVRN)
      (IF (NUMBERP FORM)
	  FORM
	  (IF (LITATOM FORM)
	      (CDR (ASSOC FORM ENVRN))
	      (IF (LISTP FORM)
		  (APPLY2 (CAR FORM)
			  (EVAL2 (CADR FORM) ENVRN)
			  (EVAL2 (CADDR FORM) ENVRN))
		  FORM))))
     Linear arithmetic and the lemmas CAR-LESSEQP, CDR-LESSEQP, and
CDR-LESSP inform us that the measure (COUNT FORM) decreases according
to the well-founded relation LESSP in each recursive call.  Hence,
EVAL2 is accepted under the definitional principle.




[ 0.52001953 0.0360026043 ]

EVAL2 


(DEFN SUBST2
      (NEW OLD TERM)
      (IF (NUMBERP TERM)
	  TERM
	  (IF (LITATOM TERM)
	      (IF (EQUAL OLD TERM) NEW TERM)
	      (IF (LISTP TERM)
		  (LIST (CAR TERM)
			(SUBST2 NEW OLD (CADR TERM))
			(SUBST2 NEW OLD (CADDR TERM)))
		  TERM))))
     Linear arithmetic and the lemmas CAR-LESSEQP, CDR-LESSEQP, and
CDR-LESSP inform us that the measure (COUNT TERM) decreases according
to the well-founded relation LESSP in each recursive call.  Hence,
SUBST2 is accepted under the principle of definition.  Observe that:
      (OR (OR (NUMBERP (SUBST2 NEW OLD TERM))
	      (LITATOM (SUBST2 NEW OLD TERM))
	      (LISTP (SUBST2 NEW OLD TERM)))
	  (EQUAL (SUBST2 NEW OLD TERM) NEW)
	  (EQUAL (SUBST2 NEW OLD TERM) TERM))
is a theorem.




[ 0.308040366 0.0619791667 ]

SUBST2 


(PROVE-LEMMA SUBST2-OK NIL
	     (EQUAL (EVAL2 (SUBST2 NEW OLD TERM) A)
		    (EVAL2 TERM
			   (CONS (CONS OLD (EVAL2 NEW A)) A)))
	     NIL)

     Call the conjecture *1.


     Perhaps we can prove it by induction.  There are three plausible
inductions.  They merge into two likely candidate inductions.
However, only one is unflawed.  We will induct according to the
following scheme:
      (AND (IMPLIES (NUMBERP TERM)
		    (P NEW OLD TERM A))
	   (IMPLIES (AND (NOT (NUMBERP TERM))
			 (LITATOM TERM)
			 (EQUAL OLD TERM))
		    (P NEW OLD TERM A))
	   (IMPLIES (AND (NOT (NUMBERP TERM))
			 (LITATOM TERM)
			 (NOT (EQUAL OLD TERM)))
		    (P NEW OLD TERM A))
	   (IMPLIES (AND (NOT (NUMBERP TERM))
			 (NOT (LITATOM TERM))
			 (LISTP TERM)
			 (P NEW OLD (CADDR TERM) A)
			 (P NEW OLD (CADR TERM) A))
		    (P NEW OLD TERM A))
	   (IMPLIES (AND (NOT (NUMBERP TERM))
			 (NOT (LITATOM TERM))
			 (NOT (LISTP TERM)))
		    (P NEW OLD TERM A))).
Linear arithmetic and the lemmas CAR-LESSEQP, CDR-LESSEQP, and
CDR-LESSP establish that the measure (COUNT TERM) decreases according
to the well-founded relation LESSP in each induction step of the
scheme.  The above induction scheme produces five new formulas:

Case 5. (IMPLIES (NUMBERP TERM)
		 (EQUAL (EVAL2 (SUBST2 NEW OLD TERM) A)
			(EVAL2 TERM
			       (CONS (CONS OLD (EVAL2 NEW A)) A)))).

  This simplifies, expanding the definitions of SUBST2 and EVAL2, to:

        T.

Case 4. (IMPLIES (AND (NOT (NUMBERP TERM))
		      (LITATOM TERM)
		      (EQUAL OLD TERM))
		 (EQUAL (EVAL2 (SUBST2 NEW OLD TERM) A)
			(EVAL2 TERM
			       (CONS (CONS OLD (EVAL2 NEW A)) A)))),

  which simplifies, applying the lemmas CDR-CONS and CAR-CONS, and
  unfolding SUBST2, ASSOC, and EVAL2, to:

        T.

Case 3. (IMPLIES (AND (NOT (NUMBERP TERM))
		      (LITATOM TERM)
		      (NOT (EQUAL OLD TERM)))
		 (EQUAL (EVAL2 (SUBST2 NEW OLD TERM) A)
			(EVAL2 TERM
			       (CONS (CONS OLD (EVAL2 NEW A)) A)))),

  which simplifies, applying CDR-CONS and CAR-CONS, and expanding the
  definitions of SUBST2, EVAL2, and ASSOC, to:

        T.

Case 2. (IMPLIES
	       (AND (NOT (NUMBERP TERM))
		    (NOT (LITATOM TERM))
		    (LISTP TERM)
		    (EQUAL (EVAL2 (SUBST2 NEW OLD (CADDR TERM))
				  A)
			   (EVAL2 (CADDR TERM)
				  (CONS (CONS OLD (EVAL2 NEW A)) A)))
		    (EQUAL (EVAL2 (SUBST2 NEW OLD (CADR TERM)) A)
			   (EVAL2 (CADR TERM)
				  (CONS (CONS OLD (EVAL2 NEW A)) A))))
	       (EQUAL (EVAL2 (SUBST2 NEW OLD TERM) A)
		      (EVAL2 TERM
			     (CONS (CONS OLD (EVAL2 NEW A)) A)))),

  which simplifies, rewriting with CDR-CONS and CAR-CONS, and opening
  up SUBST2 and EVAL2, to:

        T.

Case 1. (IMPLIES (AND (NOT (NUMBERP TERM))
		      (NOT (LITATOM TERM))
		      (NOT (LISTP TERM)))
		 (EQUAL (EVAL2 (SUBST2 NEW OLD TERM) A)
			(EVAL2 TERM
			       (CONS (CONS OLD (EVAL2 NEW A)) A)))),

  which simplifies, opening up the functions SUBST2 and EVAL2, to:

        T.


     That finishes the proof of *1.  Q.E.D.


[ 2.92314452 0.354882814 ]

SUBST2-OK 
SYSTEM
[ 0.0 0.0 ]BASIS.LISP.
GENFACT.LISP.
EVENTS.LISP.
CODE-1-A.LISP.
CODE-B-D.LISP.
CODE-E-M.LISP.
CODE-N-R.LISP.
CODE-S-Z.LISP.
IO.LISP.
PPR.LISP.
Maclisp Version 2133
REDO-UNDONE-EVENTS completed.  Here is FAILED-THMS:
NIL